From ef970fe35babae4da5227416cd285d42016b186b Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 29 May 2012 20:56:54 +0200 Subject: m_spanningtree Add channel timestamp to FTOPIC in protocol version 1204 Fixes issue #148 --- src/modules/m_spanningtree/compat.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/modules/m_spanningtree/compat.cpp') diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index f04b69e8f..a7c46cdc6 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -229,6 +229,24 @@ void TreeSocket::WriteLine(std::string line) line.erase(c, d-c); } } + else if (proto_version < 1204 && command == "FTOPIC") + { + // Drop channel TS for FTOPIC + // :sid FTOPIC #target TS TopicTS ... + // A B C D + if (b == std::string::npos) + return; + std::string::size_type c = line.find(' ', b + 1); + if (c == std::string::npos) + return; + + std::string::size_type d = line.find(' ', c + 1); + if (d == std::string::npos) + return; + + ServerInstance->Logs->Log("m_spanningtree", DEBUG, "Stripping channel TS in FTOPIC for pre-1204-protocol server"); + line.erase(c, d-c); + } } ServerInstance->Logs->Log("m_spanningtree", RAWIO, "S[%d] O %s", this->GetFd(), line.c_str()); -- cgit v1.3.1-10-gc9f91