X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_stripcolor.cpp;h=adfc8d565e8ecea97379d1335eb917f4afea840b;hb=f8ccaed31d68661d16eae1a412b337af09de111b;hp=34db0c9e58ccd04d5fd928a887aa80d10cba1cbf;hpb=7d93921aabd9c608821baec8a871aff844dfae49;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp index 34db0c9e5..adfc8d565 100644 --- a/src/modules/m_stripcolor.cpp +++ b/src/modules/m_stripcolor.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * InspIRCd: (C) 2002-2010 InspIRCd Development Team * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see @@ -20,7 +20,7 @@ class ChannelStripColor : public SimpleChannelModeHandler { public: - ChannelStripColor(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'S') { } + ChannelStripColor(Module* Creator) : SimpleChannelModeHandler(Creator, "stripcolor", 'S') { } }; /** Handles user mode +S @@ -28,7 +28,7 @@ class ChannelStripColor : public SimpleChannelModeHandler class UserStripColor : public SimpleUserModeHandler { public: - UserStripColor(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Creator, 'S') { } + UserStripColor(Module* Creator) : SimpleUserModeHandler(Creator, "stripcolor", 'S') { } }; @@ -39,7 +39,7 @@ class ModuleStripColor : public Module UserStripColor usc; public: - ModuleStripColor(InspIRCd* Me) : Module(Me), csc(Me, this), usc(Me, this) + ModuleStripColor() : csc(this), usc(this) { if (!ServerInstance->Modes->AddMode(&usc) || !ServerInstance->Modes->AddMode(&csc)) throw ModuleException("Could not add new modes!"); @@ -49,8 +49,6 @@ class ModuleStripColor : public Module virtual ~ModuleStripColor() { - ServerInstance->Modes->DelMode(&usc); - ServerInstance->Modes->DelMode(&csc); } virtual void On005Numeric(std::string &output) @@ -112,13 +110,11 @@ class ModuleStripColor : public Module else if (target_type == TYPE_CHANNEL) { Channel* t = (Channel*)dest; + ModResult res; + FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (user,t,"stripcolor")); - // check if we allow ops to bypass filtering, if we do, check if they're opped accordingly. - // note: short circut logic here, don't wreck it. -- w00t - if (CHANOPS_EXEMPT(ServerInstance, 'S') && t->GetPrefixValue(user) == OP_VALUE) - { + if (res == MOD_RES_ALLOW) return MOD_RES_PASSTHRU; - } active = !t->GetExtBanStatus(user, 'S').check(!t->IsModeSet('S')); } @@ -138,7 +134,7 @@ class ModuleStripColor : public Module virtual Version GetVersion() { - return Version("Provides channel +S mode (strip ansi colour)", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("Provides channel +S mode (strip ansi colour)", VF_VENDOR); } };