]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fail a SANICK if the target nickname already exists.
authorSadie Powell <sadie@witchery.services>
Tue, 24 Nov 2020 16:41:27 +0000 (16:41 +0000)
committerSadie Powell <sadie@witchery.services>
Tue, 24 Nov 2020 16:43:16 +0000 (16:43 +0000)
Workaround for #1791.

src/modules/m_sanick.cpp

index 724553e3c14d3c502430b21be4be094002ef16d9..31813bedf93e41579ab2d01fdc676da15008eebf 100644 (file)
@@ -69,7 +69,7 @@ class CommandSanick : public Command
                {
                        const std::string oldnick = target->nick;
                        const std::string newnick = parameters[1];
-                       if (target->ChangeNick(newnick))
+                       if (!ServerInstance->FindNickOnly(newnick) && target->ChangeNick(newnick))
                        {
                                ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SANICK to change " + oldnick + " to " + newnick);
                        }