/* When TS is equal, the alphabetically later one wins */
return (their_param < our_param);
}
-
+
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool)
{
if (adding)
{
Channel* c = NULL;
- if (!ServerInstance->IsChannel(parameter.c_str()))
+ if (IS_LOCAL(source) && !ServerInstance->IsChannel(parameter.c_str(), ServerInstance->Config->Limits.ChanMax))
{
- source->WriteNumeric(403, "%s %s :Invalid channel name",source->nick.c_str(), parameter.c_str());
+ source->WriteNumeric(403, "%s %s :Invalid channel name", source->nick.c_str(), parameter.c_str());
parameter.clear();
return MODEACTION_DENY;
}
}
return MODEACTION_DENY;
-
+
}
};
class ModuleRedirect : public Module
{
-
+
Redirect* re;
-
+
public:
-
+
ModuleRedirect(InspIRCd* Me)
: Module(Me)
{
-
+
re = new Redirect(ServerInstance);
if (!ServerInstance->Modes->AddMode(re))
throw ModuleException("Could not add new modes!");
Implementation eventlist[] = { I_OnUserPreJoin };
ServerInstance->Modules->Attach(eventlist, this, 1);
}
-
+
virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
{
if (chan)
{
- if (chan->IsModeSet('L') && chan->limit)
+ if (chan->IsModeSet('L') && chan->modes[CM_LIMIT])
{
- if (chan->GetUserCounter() >= chan->limit)
+ if (chan->GetUserCounter() >= atoi(chan->GetModeParameter('l').c_str()))
{
std::string channel = chan->GetModeParameter('L');
ServerInstance->Modes->DelMode(re);
delete re;
}
-
+
virtual Version GetVersion()
{
- return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+ return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
}
};