From 5be0c87fd0c30f46e038e78c080bd5d6b10b3eb3 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 1 Mar 2026 18:00:35 +0000 Subject: Run incoming ENCAP commands through the old protocol preprocessor. --- modules/spanningtree/compat.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'modules/spanningtree/compat.cpp') diff --git a/modules/spanningtree/compat.cpp b/modules/spanningtree/compat.cpp index 426dae490..e975262d3 100644 --- a/modules/spanningtree/compat.cpp +++ b/modules/spanningtree/compat.cpp @@ -159,6 +159,19 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, Comm // CHG* and SET* were merged in v5. cmd.replace(0, 3, "SET"); } + else if (irc::equals(cmd, "ENCAP")) + { + if (params.size() < 2) + return false; // Malformed. + + // : ENCAP [...]; + CommandBase::Params newparams(params.begin() + 2, params.end()); + if (!PreProcessOldProtocolMessage(who, params[1], newparams)) + return false; // Malformed. + + params.erase(params.begin() + 2, params.end()); + params.insert(params.end(), newparams.begin(), newparams.end()); + } if (irc::equals(cmd, "IJOIN")) { if (params.size() < 3) -- cgit v1.3.1-10-gc9f91