]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chghost.cpp
Fix crash if OnCheckBan is called and there is no list, the if was reversed.
[user/henk/code/inspircd.git] / src / modules / m_chghost.cpp
index c327d27b32631780a54f8f665c2ac34714777738..763bb2f26b940f5994597bdf90c671d314fa2215 100644 (file)
@@ -60,10 +60,16 @@ class CommandChghost : public Command
                        return CMD_FAILURE;
                }
 
-               if ((dest->ChangeDisplayedHost(parameters[1].c_str())) && (!ServerInstance->ULine(user->server)))
+               if (IS_LOCAL(dest))
                {
-                       // fix by brain - ulines set hosts silently
-                       ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost);
+                       if ((dest->ChangeDisplayedHost(parameters[1].c_str())) && (!ServerInstance->ULine(user->server)))
+                       {
+                               // fix by brain - ulines set hosts silently
+                               ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost);
+                       }
+
+                       /* ChangeDisplayedHost fixes it for us */
+                       return CMD_LOCALONLY;
                }
 
                /* route it! */