]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_blockamsg.cpp
Fix memory leak and invalid vtable location on unload of m_sslinfo
[user/henk/code/inspircd.git] / src / modules / m_blockamsg.cpp
index 1707412cf5231155ba8cb4964d11a9ca02578b58..104086bfead5ab2db940eabe3553f6fe2080d44d 100644 (file)
@@ -46,7 +46,7 @@ class ModuleBlockAmsg : public Module
  public:
        ModuleBlockAmsg(InspIRCd* Me) : Module(Me)
        {
-               this->OnRehash(NULL,"");
+               this->OnRehash(NULL);
                Implementation eventlist[] = { I_OnRehash, I_OnPreCommand, I_OnCleanup };
                ServerInstance->Modules->Attach(eventlist, this, 3);
        }
@@ -61,7 +61,7 @@ class ModuleBlockAmsg : public Module
                return Version("$Id$",VF_VENDOR,API_VERSION);
        }
 
-       virtual void OnRehash(User* user, const std::string &parameter)
+       virtual void OnRehash(User* user)
        {
                ConfigReader Conf(ServerInstance);
 
@@ -84,11 +84,11 @@ class ModuleBlockAmsg : public Module
                        action = IBLOCK_KILLOPERS;
        }
 
-       virtual int OnPreCommand(std::string &command, std::vector<std::string> &parameters, User *user, bool validated, const std::string &original_line)
+       virtual ModResult OnPreCommand(std::string &command, std::vector<std::string> &parameters, User *user, bool validated, const std::string &original_line)
        {
                // Don't do anything with unregistered users, or remote ones.
                if(!user || (user->registered != REG_ALL) || !IS_LOCAL(user))
-                       return 0;
+                       return MOD_RES_PASSTHRU;
 
                // We want case insensitive command comparison.
                // Add std::string contructor for irc::string :x
@@ -119,7 +119,7 @@ class ModuleBlockAmsg : public Module
                         */
                        if(targets == 0)
                        {
-                               return 0;
+                               return MOD_RES_PASSTHRU;
                        }
 
                        userchans = user->chans.size();
@@ -144,7 +144,7 @@ class ModuleBlockAmsg : public Module
                                else if(action == IBLOCK_NOTICE || action == IBLOCK_NOTICEOPERS)
                                        user->WriteServ( "NOTICE %s :Global message (/amsg or /ame) detected", user->nick.c_str());
 
-                               return 1;
+                               return MOD_RES_DENY;
                        }
 
                        if(m)
@@ -160,7 +160,7 @@ class ModuleBlockAmsg : public Module
                                user->Extend("amsgblock", (char*)m);
                        }
                }
-               return 0;
+               return MOD_RES_PASSTHRU;
        }
 
        void OnCleanup(int target_type, void* item)