From b390ded3f3924cbd16a5dab53a981be279360124 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 12 Jun 2013 21:44:31 +0200 Subject: m_spanningtree Move SVSMODE -> MODE translation into the appropiate place, ignore non-channel METADATA --- src/modules/m_spanningtree/compat.cpp | 6 +++++- src/modules/m_spanningtree/treesocket2.cpp | 8 +------- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 9561442b5..ad3a5fee8 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -178,7 +178,7 @@ namespace bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std::vector& 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 } diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 8b8aafd9e..328bb3c72 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -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)) -- cgit v1.2.3