* | 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 Redirect : public ModeHandler
{
public:
- Redirect(Module* Creator) : ModeHandler(Creator, 'L', PARAM_SETONLY, MODETYPE_CHANNEL) { }
-
- ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter)
- {
- if (channel->IsModeSet('L'))
- return std::make_pair(true, channel->GetModeParameter('L'));
- else
- return std::make_pair(false, parameter);
- }
+ Redirect(Module* Creator) : ModeHandler(Creator, "redirect", 'L', PARAM_SETONLY, MODETYPE_CHANNEL) { }
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
}
}
+ if (channel->GetModeParameter('L') == parameter)
+ return MODEACTION_DENY;
/*
* We used to do some checking for circular +L here, but there is no real need for this any more especially as we
* now catch +L looping in PreJoin. Remove it, since O(n) logic makes me sad, and we catch it anyway. :) -- w00t
{
if (chan)
{
- if (chan->IsModeSet('L') && chan->modes[CM_LIMIT])
+ if (chan->IsModeSet('L') && chan->IsModeSet('l'))
{
if (chan->GetUserCounter() >= atoi(chan->GetModeParameter('l').c_str()))
{
virtual ~ModuleRedirect()
{
- ServerInstance->Modes->DelMode(&re);
}
virtual Version GetVersion()
{
- return Version("Provides channel mode +L (limit redirection)", VF_COMMON | VF_VENDOR, API_VERSION);
+ return Version("Provides channel mode +L (limit redirection)", VF_VENDOR);
}
};