summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-29 22:14:58 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-29 22:14:58 +0000
commitf5aee622aa273a991e253a9f5fb5210f7e2b2a63 (patch)
tree800ac199c052efde9c36c9872f3c7b939a9a69dd
parent90ec171ba00f3fd969a8398b7ee990c8581c70ec (diff)
Moved Write() call so that it can send the NICK message properly and force the client to change
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2978 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 1fc9494ce..f6152ccf6 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -680,16 +680,19 @@ bool Server::PseudoToUser(userrec* alive,userrec* zombie,std::string message)
alive->fd = FD_MAGIC_NUMBER;
alive->FlushWriteBuf();
alive->ClearBuffer();
- Write(zombie->fd,":%s!%s@%s NICK %s",alive->nick,alive->ident,alive->host,zombie->nick);
+ // save these for later
+ std::string oldnick = alive->nick;
+ std::string oldhost = alive->host;
+ std::string oldident = alive->ident;
kill_link(alive,message.c_str());
-
if (find(local_users.begin(),local_users.end(),alive) != local_users.end())
{
local_users.erase(find(local_users.begin(),local_users.end(),alive));
log(DEBUG,"Delete local user");
}
-
+ // Fix by brain - cant write the user until their fd table entry is updated
fd_ref_table[zombie->fd] = zombie;
+ Write(zombie->fd,":%s!%s@%s NICK %s",oldnick.c_str(),oldident.c_str(),oldhost.c_str(),zombie->nick);
for (unsigned int i = 0; i < zombie->chans.size(); i++)
{
if (zombie->chans[i].channel != NULL)