From 95a8c258e2bc051e8605ee14d1643f3310221271 Mon Sep 17 00:00:00 2001 From: w00t Date: Tue, 28 Aug 2007 13:13:57 +0000 Subject: 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 --- src/modules/m_spanningtree/treesocket1.cpp | 13 ++++++++++++- src/modules/m_spanningtree/treesocket2.cpp | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/modules') 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 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 -- cgit v1.2.3