diff options
| author | 2013-08-19 20:36:41 +0200 | |
|---|---|---|
| committer | 2013-08-28 12:11:33 +0200 | |
| commit | 7432fea968127b606fc029ae462e91d3f30df8a4 (patch) | |
| tree | 396250c0766372c87e83a73d00e2018ed61cc69a /src/modules/m_spanningtree/compat.cpp | |
| parent | m_spanningtree Introduce command builders (diff) | |
| download | inspircd++-7432fea968127b606fc029ae462e91d3f30df8a4.tar.gz inspircd++-7432fea968127b606fc029ae462e91d3f30df8a4.tar.bz2 inspircd++-7432fea968127b606fc029ae462e91d3f30df8a4.zip | |
m_spanningtree Propagate topic changes via FTOPIC in order to prevent desync when two TOPIC messages cross
TOPIC is no longer accepted from servers using the new protocol
Diffstat (limited to 'src/modules/m_spanningtree/compat.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/compat.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index a9e48a10c..02e11c849 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -123,8 +123,10 @@ void TreeSocket::WriteLine(const std::string& original_line) else if (command == "FTOPIC") { // Drop channel TS for FTOPIC - // :sid FTOPIC #target TS TopicTS ... - // A B C D + // :sid FTOPIC #target TS TopicTS setter :newtopic + // A B C D E F + // :uid FTOPIC #target TS TopicTS :newtopic + // A B C D E if (b == std::string::npos) return; @@ -136,7 +138,14 @@ void TreeSocket::WriteLine(const std::string& original_line) if (d == std::string::npos) return; - line.erase(c, d-c); + std::string::size_type e = line.find(' ', d + 1); + if (line[e+1] == ':') + { + line.erase(c, e-c); + line.erase(a+1, 1); + } + else + line.erase(c, d-c); } else if ((command == "PING") || (command == "PONG")) { @@ -268,6 +277,15 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std: params.insert(params.begin()+1, "operquit"); who = MyRoot->ServerUser; } + else if ((cmd == "TOPIC") && (params.size() >= 2)) + { + // :20DAAAAAC TOPIC #chan :new topic + cmd = "FTOPIC"; + if (!InsertCurrentChannelTS(params)) + return false; + + params.insert(params.begin()+2, ConvToStr(ServerInstance->Time())); + } return true; // Passthru } |
