From c6a4d51c006566dbbe959f3272c438ab740bac9c Mon Sep 17 00:00:00 2001 From: danieldg Date: Thu, 11 Feb 2010 07:17:30 +0000 Subject: Make UID modify its parameter on a nick collision so that services has an easier time understanding things git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12433 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/uid.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 5152ef274..7059d9603 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -33,7 +33,6 @@ CmdResult CommandUID::Handle(const parameterlist ¶ms, User* serversrc) time_t age_t = ConvToInt(params[1]); time_t signon = ConvToInt(params[7]); std::string empty; - std::string nick(params[2]); std::string modestr(params[8]); TreeServer* remoteserver = Utils->FindServer(serversrc->server); @@ -50,7 +49,7 @@ CmdResult CommandUID::Handle(const parameterlist ¶ms, User* serversrc) TreeSocket* sock = remoteserver->GetRoute()->GetSocket(); /* check for collision */ - user_hash::iterator iter = ServerInstance->Users->clientlist->find(nick); + user_hash::iterator iter = ServerInstance->Users->clientlist->find(params[2]); if (iter != ServerInstance->Users->clientlist->end()) { @@ -63,7 +62,7 @@ CmdResult CommandUID::Handle(const parameterlist ¶ms, User* serversrc) if (collide != 1) { /* remote client changed, make sure we change their nick for the hash too */ - nick = params[0]; + const_cast(params)[2] = params[0]; } } @@ -79,8 +78,8 @@ CmdResult CommandUID::Handle(const parameterlist ¶ms, User* serversrc) { return CMD_INVALID; } - (*(ServerInstance->Users->clientlist))[nick] = _new; - _new->nick = nick; + (*(ServerInstance->Users->clientlist))[params[2]] = _new; + _new->nick = params[2]; _new->host = params[3]; _new->dhost = params[4]; _new->ident = params[5]; -- cgit v1.2.3