]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nickflood.cpp
Include explicit routing information in Command, will replace CMD_LOCALONLY return...
[user/henk/code/inspircd.git] / src / modules / m_nickflood.cpp
index fcc84a414627d4b1c44269d5c74b80dd8928af59..edb5aff3ecfc1191944324811f1fece72234b53b 100644 (file)
@@ -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 &parameter, 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()