]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nickflood.cpp
Fix memory leak and invalid vtable location on unload of m_sslinfo
[user/henk/code/inspircd.git] / src / modules / m_nickflood.cpp
index 6148439018d0628aa9d6f49f38adc8ac8ec556c7..17f3a35f09d01b0ed94fc2cc24d9729e2765b185 100644 (file)
@@ -213,10 +213,10 @@ class ModuleNickFlood : public Module
                ServerInstance->Modules->Attach(eventlist, this, 3);
        }
 
-       virtual int OnUserPreNick(User* user, const std::string &newnick)
+       virtual ModResult OnUserPreNick(User* user, const std::string &newnick)
        {
                if (isdigit(newnick[0])) /* allow switches to UID */
-                       return 0;
+                       return MOD_RES_PASSTHRU;
 
                for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
                {
@@ -231,7 +231,7 @@ class ModuleNickFlood : public Module
                                if (f->islocked())
                                {
                                        user->WriteNumeric(447, "%s :%s has been locked for nickchanges for 60 seconds because there have been more than %d nick changes in %d seconds", user->nick.c_str(), channel->name.c_str(), f->nicks, f->secs);
-                                       return 1;
+                                       return MOD_RES_DENY;
                                }
 
                                if (f->shouldlock())
@@ -239,12 +239,12 @@ class ModuleNickFlood : public Module
                                        f->clear();
                                        f->lock();
                                        channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :No nick changes are allowed for 60 seconds because there have been more than %d nick changes in %d seconds.", channel->name.c_str(), f->nicks, f->secs);
-                                       return 1;
+                                       return MOD_RES_DENY;
                                }
                        }
                }
 
-               return 0;
+               return MOD_RES_PASSTHRU;
        }
 
        /*