X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_blockcolor.cpp;h=2c7207698cbaab65c0d8f80bc54c15bb0fc7f30a;hb=623ba6ae49f8e1e0958f921fa178af8a95797c1c;hp=f2ba0603f6bd0d46ae63bf11d7d012107f6491aa;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index f2ba0603f..2c7207698 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -23,7 +23,7 @@ #include "inspircd.h" -/* $ModDesc: Provides support for unreal-style channel mode +c */ +/* $ModDesc: Provides channel mode +c to block color */ /** Handles the +c channel mode */ @@ -35,24 +35,26 @@ class BlockColor : public SimpleChannelModeHandler class ModuleBlockColor : public Module { - bool AllowChanOps; BlockColor bc; public: ModuleBlockColor() : bc(this) { - if (!ServerInstance->Modes->AddMode(&bc)) - throw ModuleException("Could not add new modes!"); - Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, 3); } - virtual void On005Numeric(std::string &output) + void init() CXX11_OVERRIDE { - ServerInstance->AddExtBanChar('c'); + ServerInstance->Modules->AddService(bc); + Implementation eventlist[] = { I_OnUserPreMessage, I_On005Numeric }; + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - virtual ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) + void On005Numeric(std::map& tokens) CXX11_OVERRIDE + { + tokens["EXTBAN"].push_back('c'); + } + + ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE { if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user))) { @@ -84,18 +86,9 @@ class ModuleBlockColor : public Module return MOD_RES_PASSTHRU; } - virtual ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) - { - return OnUserPreMessage(user,dest,target_type,text,status,exempt_list); - } - - virtual ~ModuleBlockColor() - { - } - - virtual Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { - return Version("Provides support for unreal-style channel mode +c",VF_VENDOR); + return Version("Provides channel mode +c to block color",VF_VENDOR); } };