diff options
| author | 2025-12-28 12:08:16 +0000 | |
|---|---|---|
| committer | 2025-12-28 12:08:16 +0000 | |
| commit | 0f78dcdd577ae79b5ca26977bde118a421a999f5 (patch) | |
| tree | 4554a5a2946ea63c3835cc91649d101c2c627d7c | |
| parent | Fix checking the accept list when user mode +z is enabled. (diff) | |
Avoid sending S2S tags to 1205 protocol servers.
| -rw-r--r-- | src/modules/m_spanningtree/compat.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
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++; } |
