From 0f78dcdd577ae79b5ca26977bde118a421a999f5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 28 Dec 2025 12:08:16 +0000 Subject: Avoid sending S2S tags to 1205 protocol servers. --- src/modules/m_spanningtree/compat.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 8be5f8ec9..c41b8e45b 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -46,7 +46,26 @@ void TreeSocket::WriteLine(const std::string& original_line) if (line[0] == '@') // Skip the tags. { - cmdstart = NextToken(line, 0); + const auto tagend = NextToken(line, cmdstart); + + auto tagsep = '@'; + std::string newtags; + irc::sepstream ss(line.substr(cmdstart + 1, tagend - cmdstart - 1), ';'); + for (std::string tag; ss.GetToken(tag); ) + { + // Skip server tags. + if (tag[0] != '~') + { + newtags.push_back(tagsep); + newtags.append(tag); + tagsep = ';'; + } + } + if (!newtags.empty()) + newtags.push_back(' '); + line.replace(cmdstart, tagend - cmdstart + 1, newtags); + + cmdstart = NextToken(line, cmdstart); if (cmdstart != std::string::npos) cmdstart++; } -- cgit v1.3.1-10-gc9f91