]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_operprefix.cpp
Fix memory leak and invalid vtable location on unload of m_sslinfo
[user/henk/code/inspircd.git] / src / modules / m_operprefix.cpp
index d416d5699b64f6c9cce9a75a47d22bc6eb45a1b7..aeea1ad196e163f59b0f2a7817a7b3152013ac37 100644 (file)
@@ -58,9 +58,9 @@ class OperPrefixMode : public ModeHandler
                        return OPERPREFIX_VALUE;
                }
 
-               ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
+               ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
                {
-                       if (servermode || (source && ServerInstance->ULine(source->server)))
+                       if (IS_FAKE(source) || (source && ServerInstance->ULine(source->server)))
                                return MODEACTION_ALLOW;
                        else
                        {
@@ -151,12 +151,12 @@ class ModuleOperPrefixMode : public Module
        }
 
        // XXX: is there a better way to do this?
-       virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt, bool servermode)
+       virtual ModResult OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt)
        {
                /* force event propagation to its ModeHandler */
-               if (!servermode && chan && (mode == 'y'))
-                       return ACR_ALLOW;
-               return 0;
+               if (!IS_FAKE(user) && chan && (mode == 'y'))
+                       return MOD_RES_ALLOW;
+               return MOD_RES_PASSTHRU;
        }
 
        virtual void OnOper(User *user, const std::string&)