X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nickflood.cpp;h=708d30e6beee622155de397b8c964a2f2f6def2b;hb=cbd32e195f5f574653550a3ed4954168ace30c55;hp=7f67b8d08f9ffc6a5cbc69bb62b39542782fa860;hpb=e80a1296a096ff2c495b3cd2a3913d5e5f6ec450;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp index 7f67b8d08..708d30e6b 100644 --- a/src/modules/m_nickflood.cpp +++ b/src/modules/m_nickflood.cpp @@ -2,7 +2,7 @@ * | 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 @@ -17,7 +17,7 @@ /** Holds settings and state associated with channel mode +F */ -class nickfloodsettings : public classbase +class nickfloodsettings { public: int secs; @@ -92,15 +92,6 @@ class NickFlood : public ModeHandler 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); @@ -207,7 +198,7 @@ class ModuleNickFlood : public Module ModResult OnUserPreNick(User* user, const std::string &newnick) { - if (isdigit(newnick[0])) /* allow switches to UID */ + if (ServerInstance->NICKForced.get(user)) /* Allow forced nick changes */ return MOD_RES_PASSTHRU; for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++) @@ -218,7 +209,7 @@ class ModuleNickFlood : public Module nickfloodsettings *f = nf.ext.get(channel); if (f) { - FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (user,channel,"nickflood")); + res = ServerInstance->OnCheckExemption(user,channel,"nickflood"); if (res == MOD_RES_ALLOW) continue; @@ -257,7 +248,7 @@ class ModuleNickFlood : public Module nickfloodsettings *f = nf.ext.get(channel); if (f) { - FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (user,channel,"nickflood")); + res = ServerInstance->OnCheckExemption(user,channel,"nickflood"); if (res == MOD_RES_ALLOW) return; @@ -277,7 +268,7 @@ class ModuleNickFlood : public Module Version GetVersion() { - return Version("Channel mode F - nick flood protection", VF_COMMON | VF_VENDOR); + return Version("Channel mode F - nick flood protection", VF_VENDOR); } };