]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket2.cpp
m_spanningtree Call the OnServerLink hook from TreeServer constructor
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket2.cpp
index 1f98f78196277bc1491dddbb8a1745a373c91972..04b850755020eebfdc0f87d820c62db5ac1e27b5 100644 (file)
@@ -220,10 +220,20 @@ User* TreeSocket::FindSource(const std::string& prefix, const std::string& comma
        if (prefix.empty())
                return MyRoot->ServerUser;
 
-       // If the prefix string is a uuid or a sid FindUUID() returns the appropriate User object
-       User* who = ServerInstance->FindUUID(prefix);
-       if (who)
-               return who;
+       if (prefix.size() == 3)
+       {
+               // Prefix looks like a sid
+               TreeServer* server = Utils->FindServerID(prefix);
+               if (server)
+                       return server->ServerUser;
+       }
+       else
+       {
+               // If the prefix string is a uuid FindUUID() returns the appropriate User object
+               User* user = ServerInstance->FindUUID(prefix);
+               if (user)
+                       return user;
+       }
 
        // Some implementations wrongly send a server name as prefix occasionally, handle that too for now
        TreeServer* const server = Utils->FindServer(prefix);
@@ -243,9 +253,9 @@ User* TreeSocket::FindSource(const std::string& prefix, const std::string& comma
                 * command came from a server to avoid desync.
                 */
 
-               who = ServerInstance->FindUUID(prefix.substr(0, 3));
-               if (who)
-                       return who;
+               TreeServer* const usersserver = Utils->FindServerID(prefix.substr(0, 3));
+               if (usersserver)
+                       return usersserver->ServerUser;
                return this->MyRoot->ServerUser;
        }
 
@@ -306,6 +316,11 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
                                this->Error(params);
                                return;
                        }
+                       else if (command == "BURST")
+                       {
+                               // This is sent even when there is no need for it, drop it here for now
+                               return;
+                       }
 
                        throw ProtocolException("Unknown command");
                }