X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nickflood.cpp;h=edb5aff3ecfc1191944324811f1fece72234b53b;hb=8cebe2878f3878afce6f643d93668155cb26801d;hp=fcc84a414627d4b1c44269d5c74b80dd8928af59;hpb=fa676cfc88cea1b167fd91f280202f9e1d35c1ca;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp index fcc84a414..edb5aff3e 100644 --- a/src/modules/m_nickflood.cpp +++ b/src/modules/m_nickflood.cpp @@ -101,12 +101,6 @@ class NickFlood : public ModeHandler return std::make_pair(false, parameter); } - bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, Channel* channel) - { - /* When TS is equal, the alphabetically later one wins */ - return (their_param < our_param); - } - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) { nickfloodsettings* dummy; @@ -206,16 +200,14 @@ class NickFlood : public ModeHandler class ModuleNickFlood : public Module { - NickFlood* jf; + NickFlood jf; public: ModuleNickFlood(InspIRCd* Me) - : Module(Me) + : Module(Me), jf(Me) { - - jf = new NickFlood(ServerInstance); - if (!ServerInstance->Modes->AddMode(jf)) + if (!ServerInstance->Modes->AddMode(&jf)) throw ModuleException("Could not add new modes!"); Implementation eventlist[] = { I_OnChannelDelete, I_OnUserPreNick, I_OnUserPostNick }; ServerInstance->Modules->Attach(eventlist, this, 3); @@ -258,7 +250,7 @@ class ModuleNickFlood : public Module /* * XXX: HACK: We do the increment on the *POST* event here (instead of all together) because we have no way of knowing whether other modules would block a nickchange. */ - virtual void OnUserPostNick(User* user, const std::string oldnick) + virtual void OnUserPostNick(User* user, const std::string &oldnick) { if (isdigit(user->nick[0])) /* allow switches to UID */ return; @@ -296,8 +288,7 @@ class ModuleNickFlood : public Module virtual ~ModuleNickFlood() { - ServerInstance->Modes->DelMode(jf); - delete jf; + ServerInstance->Modes->DelMode(&jf); } virtual Version GetVersion()