Skip to content

Commit

Permalink
Make UID modify its parameter on a nick collision so that services ha…
Browse files Browse the repository at this point in the history
…s an easier time understanding things

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12433 e03df62e-2008-0410-955e-edbf42e46eb7
  • Loading branch information
danieldg committed Feb 11, 2010
1 parent baa663e commit c6a4d51
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/modules/m_spanningtree/uid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ CmdResult CommandUID::Handle(const parameterlist &params, 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);
Expand All @@ -50,7 +49,7 @@ CmdResult CommandUID::Handle(const parameterlist &params, 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())
{
Expand All @@ -63,7 +62,7 @@ CmdResult CommandUID::Handle(const parameterlist &params, User* serversrc)
if (collide != 1)
{
/* remote client changed, make sure we change their nick for the hash too */
nick = params[0];
const_cast<parameterlist&>(params)[2] = params[0];
}
}

Expand All @@ -79,8 +78,8 @@ CmdResult CommandUID::Handle(const parameterlist &params, 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];
Expand Down

0 comments on commit c6a4d51

Please sign in to comment.