else
{
// new mode param, replace old with new
- if ((nsecs > 0) && (njoins > 0))
- {
- f = new joinfloodsettings(nsecs, njoins);
- ext.set(channel, f);
- channel->SetModeParam('j', parameter);
- return MODEACTION_ALLOW;
- }
- else
- {
- return MODEACTION_DENY;
- }
+ f = new joinfloodsettings(nsecs, njoins);
+ ext.set(channel, f);
+ channel->SetModeParam('j', parameter);
+ return MODEACTION_ALLOW;
}
}
}
}
else
{
- joinfloodsettings* f = ext.get(channel);
- if (f)
+ if (channel->IsModeSet('j'))
{
ext.unset(channel);
channel->SetModeParam('j', "");
void init()
{
- if (!ServerInstance->Modes->AddMode(&jf))
- throw ModuleException("Could not add new modes!");
- ServerInstance->Extensions.Register(&jf.ext);
+ ServerInstance->Modules->AddService(jf);
+ ServerInstance->Modules->AddService(jf.ext);
Implementation eventlist[] = { I_OnUserPreJoin, I_OnUserJoin };
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
joinfloodsettings *f = jf.ext.get(memb->chan);
/* But all others are OK */
- if (f)
+ if ((f) && (!f->islocked()))
{
f->addjoin();
if (f->shouldlock())