X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_blockcolor.cpp;h=d843fc9b00410d89d02b2eb9f6ae50ae0d9815e2;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=19b5c9231456a7ad9127c54495c286dcc3908fba;hpb=74ee9af96639323d852a8b15be72ee9974e0a826;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index 19b5c9231..d843fc9b0 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -35,21 +35,23 @@ 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!"); + } + + void init() + { + ServerInstance->Modules->AddService(bc); Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, 3); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - virtual void On005Numeric(std::string &output) + virtual void On005Numeric(std::map& tokens) { - ServerInstance->AddExtBanChar('c'); + tokens["EXTBAN"].push_back('c'); } virtual ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) @@ -89,10 +91,6 @@ class ModuleBlockColor : public Module return OnUserPreMessage(user,dest,target_type,text,status,exempt_list); } - virtual ~ModuleBlockColor() - { - } - virtual Version GetVersion() { return Version("Provides channel mode +c to block color",VF_VENDOR);