]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_invisible.cpp
Fix silly oversight discovered by tra26 (thanks!) where the core tries to handle...
[user/henk/code/inspircd.git] / src / modules / m_invisible.cpp
index 6a1dd700db91d4949429c045f15f6c1098220fe8..c1b2dcc7f019ce4ea126ad668484984c7849741f 100644 (file)
@@ -55,27 +55,27 @@ class InvisibleMode : public ModeHandler
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
-               if (source != dest)
-                       return MODEACTION_DENY;
-
                if (dest->IsModeSet('Q') != adding)
                {
                        bool ok = false;
 
-                       for (int j = 0; j < conf->Enumerate("type"); j++)
+                       if (IS_LOCAL(source))
                        {
-                               std::string opertype = conf->ReadValue("type","name",j);
-                               if (opertype == source->oper)
+                               for (int j = 0; j < conf->Enumerate("type"); j++)
                                {
-                                       ok = conf->ReadFlag("type", "canquiet", j);
-                                       break;
+                                       std::string opertype = conf->ReadValue("type","name",j);
+                                       if (opertype == source->oper)
+                                       {
+                                               ok = conf->ReadFlag("type", "canquiet", j);
+                                               break;
+                                       }
                                }
-                       }
 
-                       if (!ok)
-                       {
-                               source->WriteNumeric(481, "%s :Permission Denied - You do not have access to become invisible via user mode +Q", source->nick.c_str());
-                               return MODEACTION_DENY;
+                               if (!ok)
+                               {
+                                       source->WriteNumeric(481, "%s :Permission Denied - You do not have access to become invisible via user mode +Q", source->nick.c_str());
+                                       return MODEACTION_DENY;
+                               }
                        }
 
                        dest->SetMode('Q', adding);
@@ -169,8 +169,8 @@ class ModuleInvisible : public Module
 
                /* Yeah i know people can take this out. I'm not about to obfuscate code just to be a pain in the ass. */
                ServerInstance->Users->ServerNoticeAll("*** m_invisible.so has just been loaded on this network. For more information, please visit http://inspircd.org/wiki/Modules/invisible");
-               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserJoin, I_OnUserPart, I_OnUserQuit, I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, 6);
+               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserJoin, I_OnUserPart, I_OnUserQuit, I_OnRehash, I_OnHostCycle };
+               ServerInstance->Modules->Attach(eventlist, this, 7);
        };
 
        virtual ~ModuleInvisible()