summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-11-24 16:41:27 +0000
committerSadie Powell <sadie@witchery.services>2020-11-24 16:43:16 +0000
commit78db7544d26cdeffeb2bd8045529fe90bd5d852d (patch)
treeacb6319789f2a79d4351a0154456d70215223fea
parentc71361e8e4f22cb4f72881399bce2832eb080b0e (diff)
Fail a SANICK if the target nickname already exists.
Workaround for #1791.
-rw-r--r--src/modules/m_sanick.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp
index 724553e3c..31813bedf 100644
--- a/src/modules/m_sanick.cpp
+++ b/src/modules/m_sanick.cpp
@@ -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);
}