From 00527f157b75c0523f1ee7b38d2138685c6663d7 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 12 Jun 2013 21:43:14 +0200 Subject: m_spanningtree Rewrite incoming (E|G|K|Q|Z)LINE commands from 2.0 servers into ADDLINE/DELLINE These commands were never documented to be usable in the server protocol but we accepted them nevertheless from servers --- src/modules/m_spanningtree/compat.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 17266afe9..9561442b5 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -219,6 +219,29 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std: params[0] = server->GetID(); } } + else if ((cmd == "GLINE") || (cmd == "KLINE") || (cmd == "ELINE") || (cmd == "ZLINE") || (cmd == "QLINE")) + { + // Fix undocumented protocol usage: translate GLINE, ZLINE, etc. into ADDLINE or DELLINE + if ((params.size() != 1) && (params.size() != 3)) + return false; + + parameterlist p; + p.push_back(cmd.substr(0, 1)); + p.push_back(params[0]); + + if (params.size() == 3) + { + cmd = "ADDLINE"; + p.push_back(who->nick); + p.push_back(ConvToStr(ServerInstance->Time())); + p.push_back(ConvToStr(InspIRCd::Duration(params[1]))); + p.push_back(params[2]); + } + else + cmd = "DELLINE"; + + params.swap(p); + } return true; // Passthru } -- cgit v1.2.3