From df02679c15f8d9966e8a14d6ae1077ec66f1b6b8 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 4 Dec 2005 12:43:13 +0000 Subject: Tweaked nick collision code git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2134 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 5eab7ca34..9484c282b 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -629,8 +629,12 @@ class TreeSocket : public InspSocket { // nick collision log(DEBUG,"Nick collision on %s!%s@%s: %lu %lu",tempnick,ident.c_str(),host.c_str(),(unsigned long)age,(unsigned long)iter->second->age); - this->WriteLine(":"+Srv->GetServerName()+" KILL "+tempnick+" :Nickname collision"); - return true; + if (iter->second->age > age) + { + // ours is older than theirs, ours stays. Ignore their NICK, send KILL. + this->WriteLine(":"+Srv->GetServerName()+" KILL "+tempnick+" :Nickname collision"); + return true; + } } clientlist[tempnick] = new userrec(); -- cgit v1.2.3