summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-30 13:03:17 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-30 13:03:17 +0000
commitde0ba7eff9560f79b5be464034fd372de1c44031 (patch)
tree9c4d2ffaf1052e921831c1150db9021649a3944a /src/modules
parent8eee1026bc80751cbf86c2e0685945f6d0302fee (diff)
Added TS nick collision stuff (ugh)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2049 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index df2939f76..0991dacdd 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -557,7 +557,31 @@ class TreeSocket : public InspSocket
{
// nick collision
log(DEBUG,"Nick collision on %s!%s@%s",tempnick,ident.c_str(),host.c_str());
- return true;
+ if (age <= iter->second->age)
+ {
+ // remote client is older
+ // if hosts are identical, kill the remote,
+ // else kill the local. We must send KILL for
+ // removal of remote users.
+ if (!strcmp(iter->second->host,host.c_str()))
+ {
+ // kill the remote by sending KILL,
+ // and ABORT to stop it being introduced here.
+ this->WriteLine(":"+Srv->GetServerName()+" KILL "+tempnick+" :Killed (Nickname collision from "+Srv->GetServerName()+")");
+ return true;
+ }
+ else
+ {
+ // kill our local and continue to let the remote be introduced
+ Srv->QuitUser(iter->second,"Killed (Nickname collision from "+source+")");
+ }
+ }
+ else
+ {
+ // remote is newer, kill it and bail to stop it being introduced
+ this->WriteLine(":"+Srv->GetServerName()+" KILL "+tempnick+" :Killed (Nickname collision from "+Srv->GetServerName()+")");
+ return true;
+ }
}
clientlist[tempnick] = new userrec();