From 47f66dc6cf78dde18f8984e61a6fa9a822d1d781 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 1 Feb 2006 21:45:47 +0000 Subject: *TEST* nick collision code for NICK change in server link git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3009 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index b081b1d4b..8117b7ef9 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -2126,6 +2126,20 @@ class TreeSocket : public InspSocket } if (who) { + if ((command == "NICK") && (params.size() > 0)) + { + /* On nick messages, check that the nick doesnt + * already exist here. If it does, kill their copy, + * and our copy. + */ + userrec* x = Srv->FindNick(params[0]); + if (x) + { + this->WriteLine(":"+Srv->GetServerName()+" KILL "+params[0]+" :Nickname collision ("+prefix+" -> "+params[0]+")"); + Srv->QuitUser(x,"Nickname collision ("+prefix+" -> "+params[0]+")"); + return DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params); + } + } // its a user target = who->server; char* strparams[127]; -- cgit v1.2.3