summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-06-12 21:43:14 +0200
committerattilamolnar <attilamolnar@hush.com>2013-06-12 21:43:14 +0200
commit00527f157b75c0523f1ee7b38d2138685c6663d7 (patch)
tree008de8cb0cd8fd4f4e1c9c5d0b4ebd7b5760c0bc /src/modules/m_spanningtree
parent623ba6ae49f8e1e0958f921fa178af8a95797c1c (diff)
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
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/compat.cpp23
1 files changed, 23 insertions, 0 deletions
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
}