* | 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
/** Holds settings and state associated with channel mode +F
*/
-class nickfloodsettings : public classbase
+class nickfloodsettings
{
public:
int secs;
NickFlood(Module* Creator) : ModeHandler(Creator, "nickflood", 'F', PARAM_SETONLY, MODETYPE_CHANNEL),
ext("nickflood", Creator) { }
- ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter)
- {
- nickfloodsettings* x = ext.get(channel);
- if (x)
- return std::make_pair(true, ConvToStr(x->nicks)+":"+ConvToStr(x->secs));
- else
- return std::make_pair(false, parameter);
- }
-
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
nickfloodsettings *f = ext.get(channel);
{
if (!ServerInstance->Modes->AddMode(&nf))
throw ModuleException("Could not add new modes!");
- Extensible::Register(&nf.ext);
+ ServerInstance->Extensions.Register(&nf.ext);
Implementation eventlist[] = { I_OnUserPreNick, I_OnUserPostNick };
ServerInstance->Modules->Attach(eventlist, this, 2);
}
nickfloodsettings *f = nf.ext.get(channel);
if (f)
{
- FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (channel->GetUser(user),channel,"nickflood"));
+ FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (user,channel,"nickflood"));
if (res == MOD_RES_ALLOW)
continue;
nickfloodsettings *f = nf.ext.get(channel);
if (f)
{
- FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (channel->GetUser(user),channel,"nickflood"));
+ FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (user,channel,"nickflood"));
if (res == MOD_RES_ALLOW)
return;
Version GetVersion()
{
- return Version("Channel mode F - nick flood protection", VF_COMMON | VF_VENDOR);
+ return Version("Channel mode F - nick flood protection", VF_VENDOR);
}
};