}
else
{
- if (((nlines != f->lines) || (nsecs != f->secs)) && ((nsecs > 0) && (nlines > 0)) || (ban != f->ban))
+ if ((((nlines != f->lines) || (nsecs != f->secs) || (ban != f->ban))) && (((nsecs > 0) && (nlines > 0))))
{
delete f;
floodsettings *fs = new floodsettings(ban,nsecs,nlines);
return MODEACTION_ALLOW;
}
}
-
+
return MODEACTION_DENY;
}
};
class ModuleMsgFlood : public Module
{
-
+
MsgFlood* mf;
-
+
public:
-
+
ModuleMsgFlood(InspIRCd* Me)
: Module(Me)
{
-
+
mf = new MsgFlood(ServerInstance);
if (!ServerInstance->Modes->AddMode(mf))
throw ModuleException("Could not add new modes!");
Implementation eventlist[] = { I_OnChannelDelete, I_OnUserPreNotice, I_OnUserPreMessage };
ServerInstance->Modules->Attach(eventlist, this, 3);
}
-
+
int ProcessMessages(User* user,Channel* dest, const std::string &text)
{
- if (!IS_LOCAL(user) || CHANOPS_EXEMPT(ServerInstance, 'f') && dest->GetStatus(user) == STATUS_OP)
+ if (!IS_LOCAL(user) || (CHANOPS_EXEMPT(ServerInstance, 'f') && dest->GetStatus(user) == STATUS_OP))
{
return 0;
}
return 1;
}
}
-
+
return 0;
}
{
if (target_type == TYPE_CHANNEL)
return ProcessMessages(user,(Channel*)dest,text);
-
+
return 0;
}
{
if (target_type == TYPE_CHANNEL)
return ProcessMessages(user,(Channel*)dest,text);
-
+
return 0;
}
ServerInstance->Modes->DelMode(mf);
delete mf;
}
-
+
virtual Version GetVersion()
{
- return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+ return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
}
};