X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_blockcolor.cpp;h=43d0826dd7138954b28f61acb66d5bc00008bcd9;hb=12a47e788b3eba8e395abdd46c2dc91692b9b292;hp=7c961d96aab49f2bfd902d5e00dcac03638fd5f9;hpb=ff3b706b2506d7614bce5e54bc88657bd62ebd4d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index 7c961d96a..43d0826dd 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -24,23 +24,15 @@ #include "inspircd.h" #include "modules/exemption.h" -/** Handles the +c channel mode - */ -class BlockColor : public SimpleChannelModeHandler -{ - public: - BlockColor(Module* Creator) : SimpleChannelModeHandler(Creator, "blockcolor", 'c') { } -}; - class ModuleBlockColor : public Module { CheckExemption::EventProvider exemptionprov; - BlockColor bc; + SimpleChannelModeHandler bc; public: ModuleBlockColor() : exemptionprov(this) - , bc(this) + , bc(this, "blockcolor", 'c') { } @@ -49,20 +41,19 @@ class ModuleBlockColor : public Module 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 + ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE { - if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user))) + if ((target.type == MessageTarget::TYPE_CHANNEL) && (IS_LOCAL(user))) { - Channel* c = (Channel*)dest; - ModResult res; - FIRST_MOD_RESULT_CUSTOM(exemptionprov, CheckExemption::EventListener, OnCheckExemption, res, (user, c, "blockcolor")); + Channel* c = target.Get(); + ModResult res = CheckExemption::Call(exemptionprov, user, c, "blockcolor"); if (res == MOD_RES_ALLOW) return MOD_RES_PASSTHRU; if (!c->GetExtBanStatus(user, 'c').check(!c->IsModeSet(bc))) { - for (std::string::iterator i = text.begin(); i != text.end(); i++) + for (std::string::iterator i = details.text.begin(); i != details.text.end(); i++) { switch (*i) {