]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_spanningtree Move SVSMODE -> MODE translation into the appropiate place, ignore...
authorattilamolnar <attilamolnar@hush.com>
Wed, 12 Jun 2013 19:44:31 +0000 (21:44 +0200)
committerattilamolnar <attilamolnar@hush.com>
Wed, 12 Jun 2013 19:44:31 +0000 (21:44 +0200)
src/modules/m_spanningtree/compat.cpp
src/modules/m_spanningtree/treesocket2.cpp

index 9561442b5c4ac70bf1b625269ca2b7ab074976d2..ad3a5fee8d63d874b5d0baa11193a2a38f0b6859 100644 (file)
@@ -178,7 +178,7 @@ namespace
 
 bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std::vector<std::string>& params)
 {
-       if ((cmd == "METADATA") && (params.size() >= 3))
+       if ((cmd == "METADATA") && (params.size() >= 3) && (params[0][0] == '#'))
        {
                // :20D METADATA #channel extname :extdata
                return InsertCurrentChannelTS(params);
@@ -242,6 +242,10 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std:
 
                params.swap(p);
        }
+       else if (cmd == "SVSMODE")
+       {
+               cmd = "MODE";
+       }
 
        return true; // Passthru
 }
index 8b8aafd9e655cf7db93cfb6931ce3920de989094..328bb3c72e8d66cd96d2c3ae35f64a45c5a1fe22 100644 (file)
@@ -303,13 +303,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
                return;
        }
 
-       /*
-        * First up, check for any malformed commands (e.g. MODE without a timestamp)
-        * and rewrite commands where necessary (SVSMODE -> MODE for services). -- w
-        */
-       if (command == "SVSMODE") // This isn't in an "else if" so we still force FMODE for changes on channels.
-               command = "MODE";
-
+       // Translate commands coming from servers using an older protocol
        if (proto_version < ProtocolVersion)
        {
                if (!PreProcessOldProtocolMessage(who, command, params))