]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Handle nick change collision through the same rules nick introduction collision is...
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Tue, 28 Aug 2007 13:13:57 +0000 (13:13 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Tue, 28 Aug 2007 13:13:57 +0000 (13:13 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7937 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/treesocket1.cpp
src/modules/m_spanningtree/treesocket2.cpp

index a7f1ae66cab3aaca6056dc438a7b1c34eed00b38..1a753107447af688a4ed47412da5730d0a2563e2 100644 (file)
@@ -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;
index 34cf318e30d9ec7488d445ca500d89db9b73f53a..9a52e63f29046e60614f48eafb2065da6288c43e 100644 (file)
@@ -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