From f5aee622aa273a991e253a9f5fb5210f7e2b2a63 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 29 Jan 2006 22:14:58 +0000 Subject: 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 --- src/modules.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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) -- cgit v1.2.3