X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nonotice.cpp;h=cab367ad9e6abe49e879a275911a1feb79d57c3a;hb=63aa8d0d42f619c52d382bde3e6ba2e5e23b12ac;hp=2063628451fb227def141a51e988cc09bf860caa;hpb=0d95204c9848a56b02a1aca717ddca7f5e60e5a6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp index 206362845..cab367ad9 100644 --- a/src/modules/m_nonotice.cpp +++ b/src/modules/m_nonotice.cpp @@ -21,8 +21,6 @@ #include "inspircd.h" -/* $ModDesc: Provides channel mode +T to block notices to the channel */ - class NoNotice : public SimpleChannelModeHandler { public: @@ -39,13 +37,6 @@ class ModuleNoNotice : public Module { } - 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,14 +48,14 @@ class ModuleNoNotice : public Module if ((msgtype == MSG_NOTICE) && (target_type == TYPE_CHANNEL) && (IS_LOCAL(user))) { Channel* c = (Channel*)dest; - if (!c->GetExtBanStatus(user, 'T').check(!c->IsModeSet('T'))) + if (!c->GetExtBanStatus(user, 'T').check(!c->IsModeSet(nt))) { res = ServerInstance->OnCheckExemption(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, "%s :Can't send NOTICE to channel (+T set)", c->name.c_str()); return MOD_RES_DENY; } }