summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-06-12 21:44:31 +0200
committerattilamolnar <attilamolnar@hush.com>2013-06-12 21:44:31 +0200
commitb390ded3f3924cbd16a5dab53a981be279360124 (patch)
treea98b082de1e231b7d9ef655e0422a8c3ffde0318 /src/modules/m_spanningtree
parent00527f157b75c0523f1ee7b38d2138685c6663d7 (diff)
m_spanningtree Move SVSMODE -> MODE translation into the appropiate place, ignore non-channel METADATA
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/compat.cpp6
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp8
2 files changed, 6 insertions, 8 deletions
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<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
}
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))