]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/uid.cpp
m_spanningtree Remove now unused TreeServer::Tidy()
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / uid.cpp
index 4d8f822037e5667298f89d8da3ea556585c71f82..39857361692e9170dd77c26001b004202429821b 100644 (file)
@@ -43,7 +43,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, std::vector<std::st
        if (modestr[0] != '+')
                throw ProtocolException("Invalid mode string");
 
-       /* check for collision */
+       // See if there is a nick collision
        User* collideswith = ServerInstance->FindNickOnly(params[2]);
        if ((collideswith) && (collideswith->registered != REG_ALL))
        {
@@ -58,15 +58,16 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, std::vector<std::st
        }
        else if (collideswith)
        {
-               /*
-                * Nick collision.
-                */
-               int collide = Utils->DoCollision(collideswith, remoteserver, age_t, params[5], params[6], params[0]);
-               ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "*** Collision on %s, collide=%d", params[2].c_str(), collide);
+               // The user on this side is registered, handle the collision
+               bool they_change = Utils->DoCollision(collideswith, remoteserver, age_t, params[5], params[6], params[0]);
+               ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Collision on %s %d", params[2].c_str(), they_change);
 
-               if (collide != 1)
+               if (they_change)
                {
-                       // Remote client lost, make sure we change their nick for the hash too
+                       // The client being introduced needs to change nick to uuid, change the nick in the message before
+                       // processing/forwarding it. Also change the nick TS to CommandSave::SavedTimestamp.
+                       age_t = CommandSave::SavedTimestamp;
+                       params[1] = ConvToStr(CommandSave::SavedTimestamp);
                        params[2] = params[0];
                }
        }
@@ -128,7 +129,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, std::vector<std::st
 
        bool dosend = true;
 
-       if ((Utils->quiet_bursts && remoteserver->bursting) || _new->server->IsSilentULine())
+       if ((Utils->quiet_bursts && remoteserver->IsBehindBursting()) || _new->server->IsSilentULine())
                dosend = false;
 
        if (dosend)