diff options
| author | 2012-05-29 20:56:54 +0200 | |
|---|---|---|
| committer | 2012-05-29 20:56:54 +0200 | |
| commit | ef970fe35babae4da5227416cd285d42016b186b (patch) | |
| tree | 43f8dffa67b981fbb035b09caa150aaa0e87bf4d /src/modules/m_spanningtree/compat.cpp | |
| parent | m_spanningtree Add timestamp to channel METADATA, introduce protocol version ... (diff) | |
m_spanningtree Add channel timestamp to FTOPIC in protocol version 1204
Fixes issue #148
Diffstat (limited to 'src/modules/m_spanningtree/compat.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/compat.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
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()); |
