summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-08 15:52:41 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-08 15:52:41 +0000
commit55143d5f18e82f02b1766e1d2377f099f5a66e6a (patch)
treeac6c2f1fa9bacf7d6d280974d4f49c142df8b59b /src/modules
parent53586eb28c0f76bea537faf6f2a9fc17995eb005 (diff)
Only put out SANICK success line if the nickchange succeeds
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5164 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_sanick.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp
index bbecfb9cf..65ef97d4b 100644
--- a/src/modules/m_sanick.cpp
+++ b/src/modules/m_sanick.cpp
@@ -49,17 +49,17 @@ class cmd_sanick : public command_t
}
if (ServerInstance->IsNick(parameters[1]))
{
- // FIX by brain: Cant use source->nick here because if it traverses a server link then
- // source->nick becomes invalid as the object data moves in memory.
- ServerInstance->WriteOpers(std::string(user->nick)+" used SANICK to change "+std::string(parameters[0])+" to "+parameters[1]);
- if (!source->ForceNickChange(parameters[1]))
+ if (source->ForceNickChange(parameters[1]))
+ {
+ ServerInstance->WriteOpers(std::string(user->nick)+" used SANICK to change "+std::string(parameters[0])+" to "+parameters[1]);
+ return CMD_SUCCESS;
+ }
+ else
{
/* We couldnt change the nick */
userrec::QuitUser(ServerInstance, source, "Nickname collision");
return CMD_FAILURE;
}
-
- return CMD_SUCCESS;
}
return CMD_FAILURE;