diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-28 13:13:57 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-28 13:13:57 +0000 |
commit | 95a8c258e2bc051e8605ee14d1643f3310221271 (patch) | |
tree | 493937a1dbf3fb53f14615919c5d822869416461 /src | |
parent | ea0622b83cb8c993be47f2448ae035cbf1ee3b7f (diff) |
Handle nick change collision through the same rules nick introduction collision is handled. No code duplication, and now, no kills either.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7937 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 6 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index a7f1ae66c..1a7531074 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -999,7 +999,18 @@ int TreeSocket::DoCollision(userrec *u, time_t remotets, const char *remoteident * have 928AAAB's nick set to that. * -- w00t */ - this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" SVSNICK "+remoteuid+" " + remoteuid); + userrec *remote = this->Instance->FindUUID(remoteuid); + + if (remote) + { + /* buh.. nick change collide. force change their nick. */ + remote->ForceNickChange(remote->uuid); + } + else + { + /* user has not been introduced yet, just inform their server */ + this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" SVSNICK "+remoteuid+" " + remoteuid); + } if (!bChangeRemote) return 2; diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 34cf318e3..9a52e63f2 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -1500,6 +1500,11 @@ bool TreeSocket::ProcessLine(std::string &line) userrec* x = this->Instance->FindNick(params[0]); if ((x) && (x != who)) { + /* x is local, who is remote */ + this->DoCollision(x, who->age, who->ident, who->GetIPString(), who->uuid); + return true; +/* +Old nickname collision logic.. std::deque<std::string> p; p.push_back(params[0]); p.push_back(":Nickname collision ("+prefix+" -> "+params[0]+")"); @@ -1515,6 +1520,7 @@ bool TreeSocket::ProcessLine(std::string &line) userrec::QuitUser(this->Instance,y,"Nickname collision"); } return Utils->DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params); +*/ } } // its a user |