* | 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
class ChannelStripColor : public SimpleChannelModeHandler
{
public:
- ChannelStripColor(Module* Creator) : SimpleChannelModeHandler(Creator, 'S') { }
+ ChannelStripColor(Module* Creator) : SimpleChannelModeHandler(Creator, "stripcolor", 'S') { }
};
/** Handles user mode +S
class UserStripColor : public SimpleUserModeHandler
{
public:
- UserStripColor(Module* Creator) : SimpleUserModeHandler(Creator, 'S') { }
+ UserStripColor(Module* Creator) : SimpleUserModeHandler(Creator, "u_stripcolor", 'S') { }
};
public:
ModuleStripColor() : csc(this), usc(this)
{
- if (!ServerInstance->Modes->AddMode(&usc) || !ServerInstance->Modes->AddMode(&csc))
- throw ModuleException("Could not add new modes!");
+ }
+
+ void init()
+ {
+ ServerInstance->Modules->AddService(usc);
+ ServerInstance->Modules->AddService(csc);
Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
ServerInstance->Modules->Attach(eventlist, this, 3);
}
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('S') && t->GetPrefixValue(user) == OP_VALUE)
- {
+ if (res == MOD_RES_ALLOW)
return MOD_RES_PASSTHRU;
- }
active = !t->GetExtBanStatus(user, 'S').check(!t->IsModeSet('S'));
}
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);
}
};