]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix some confusing logic in sanick.
authorSadie Powell <sadie@witchery.services>
Tue, 24 Nov 2020 16:28:02 +0000 (16:28 +0000)
committerSadie Powell <sadie@witchery.services>
Tue, 24 Nov 2020 16:43:16 +0000 (16:43 +0000)
src/modules/m_sanick.cpp

index 5255d31b8c54738ebd260f807812f492c7aeb7f6..724553e3c14d3c502430b21be4be094002ef16d9 100644 (file)
@@ -67,15 +67,15 @@ class CommandSanick : public Command
                /* Have we hit target's server yet? */
                if (target && IS_LOCAL(target))
                {
-                       std::string oldnick = user->nick;
-                       std::string newnick = target->nick;
-                       if (target->ChangeNick(parameters[1]))
+                       const std::string oldnick = target->nick;
+                       const std::string newnick = parameters[1];
+                       if (target->ChangeNick(newnick))
                        {
-                               ServerInstance->SNO->WriteGlobalSno('a', oldnick+" used SANICK to change "+newnick+" to "+parameters[1]);
+                               ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SANICK to change " + oldnick + " to " + newnick);
                        }
                        else
                        {
-                               ServerInstance->SNO->WriteGlobalSno('a', oldnick+" failed SANICK (from "+newnick+" to "+parameters[1]+")");
+                               ServerInstance->SNO->WriteGlobalSno('a', user->nick + " failed SANICK (from " + oldnick + " to " + newnick + ")");
                        }
                }