X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nonotice.cpp;h=ec5be951735ad68231ec059d1f62c8d48eb186b3;hb=9de9231380d42955a13f07d7843897c77af704e4;hp=1fdbdde2a0c8fdf823d8fc1f42db7c4ca86dd9e8;hpb=fd0fa86da89ab4cefa778307088ef2552a05a170;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp index 1fdbdde2a..ec5be9517 100644 --- a/src/modules/m_nonotice.cpp +++ b/src/modules/m_nonotice.cpp @@ -20,6 +20,7 @@ #include "inspircd.h" +#include "modules/exemption.h" class NoNotice : public SimpleChannelModeHandler { @@ -29,21 +30,16 @@ class NoNotice : public SimpleChannelModeHandler class ModuleNoNotice : public Module { + CheckExemption::EventProvider exemptionprov; NoNotice nt; public: ModuleNoNotice() - : nt(this) + : exemptionprov(this) + , nt(this) { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(nt); - Implementation eventlist[] = { I_OnUserPreMessage, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); - } - void On005Numeric(std::map& tokens) CXX11_OVERRIDE { tokens["EXTBAN"].push_back('T'); @@ -57,12 +53,12 @@ class ModuleNoNotice : public Module Channel* c = (Channel*)dest; if (!c->GetExtBanStatus(user, 'T').check(!c->IsModeSet(nt))) { - res = ServerInstance->OnCheckExemption(user,c,"nonotice"); + FIRST_MOD_RESULT_CUSTOM(exemptionprov, CheckExemption::EventListener, OnCheckExemption, res, (user, c, "nonotice")); if (res == MOD_RES_ALLOW) return MOD_RES_PASSTHRU; else { - user->WriteNumeric(ERR_CANNOTSENDTOCHAN, "%s %s :Can't send NOTICE to channel (+T set)",user->nick.c_str(), c->name.c_str()); + user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, "Can't send NOTICE to channel (+T set)"); return MOD_RES_DENY; } }