- f = new nickfloodsettings(ServerInstance, nsecs, nnicks);
+ f = new nickfloodsettings(nsecs, nnicks);
ext.set(channel, f);
channel->SetModeParam('F', parameter);
return MODEACTION_ALLOW;
ext.set(channel, f);
channel->SetModeParam('F', parameter);
return MODEACTION_ALLOW;
@@ -159,7+157,7 @@ class NickFlood : public ModeHandler
// new mode param, replace old with new
if ((nsecs > 0) && (nnicks > 0))
{
// new mode param, replace old with new
if ((nsecs > 0) && (nnicks > 0))
{
- f = new nickfloodsettings(ServerInstance, nsecs, nnicks);
+ f = new nickfloodsettings(nsecs, nnicks);
ext.set(channel, f);
channel->SetModeParam('F', parameter);
return MODEACTION_ALLOW;
ext.set(channel, f);
channel->SetModeParam('F', parameter);
return MODEACTION_ALLOW;
@@ -197,8+195,8 @@ class ModuleNickFlood : public Module
public:
public:
- ModuleNickFlood(InspIRCd* Me)
- : Module(Me), nf(Me, this)
+ ModuleNickFlood()
+ : nf(this)
{
if (!ServerInstance->Modes->AddMode(&nf))
throw ModuleException("Could not add new modes!");
{
if (!ServerInstance->Modes->AddMode(&nf))
throw ModuleException("Could not add new modes!");
@@ -214,12+212,12 @@ class ModuleNickFlood : public Module
for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
{
for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
{
- Channel *channel = i->first;
+ Channel *channel = *i;
nickfloodsettings *f = nf.ext.get(channel);
if (f)
{
nickfloodsettings *f = nf.ext.get(channel);
if (f)
{
- if (CHANOPS_EXEMPT(ServerInstance, 'F') && channel->GetStatus(user) == STATUS_OP)
+ if (CHANOPS_EXEMPT('F') && channel->GetPrefixValue(user) == OP_VALUE)
continue;
if (f->islocked())
continue;
if (f->islocked())
@@ -232,7+230,7 @@ class ModuleNickFlood : public Module
{
f->clear();
f->lock();
{
f->clear();
f->lock();
- channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :No nick changes are allowed for 60 seconds because there have been more than %d nick changes in %d seconds.", channel->name.c_str(), f->nicks, f->secs);
+ channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName.c_str(), "NOTICE %s :No nick changes are allowed for 60 seconds because there have been more than %d nick changes in %d seconds.", channel->name.c_str(), f->nicks, f->secs);
return MOD_RES_DENY;
}
}
return MOD_RES_DENY;
}
}
@@ -251,12+249,12 @@ class ModuleNickFlood : public Module
for (UCListIter i = user->chans.begin(); i != user->chans.end(); ++i)
{
for (UCListIter i = user->chans.begin(); i != user->chans.end(); ++i)
{
- Channel *channel = i->first;
+ Channel *channel = *i;
nickfloodsettings *f = nf.ext.get(channel);
if (f)
{
nickfloodsettings *f = nf.ext.get(channel);
if (f)
{
- if (CHANOPS_EXEMPT(ServerInstance, 'F') && channel->GetStatus(user) == STATUS_OP)
+ if (CHANOPS_EXEMPT('F') && channel->GetPrefixValue(user) == OP_VALUE)
return;
/* moved this here to avoid incrementing the counter for nick
return;
/* moved this here to avoid incrementing the counter for nick
@@ -271,7+269,6 @@ class ModuleNickFlood : public Module