diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-11 15:13:58 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-11 15:13:58 +0200 |
commit | 17cd4ada26f5a7545396531feec10ed490307dd6 (patch) | |
tree | f958e7eb88ad9219f56abf6e855a4ddf8ba16e3f /src/modules | |
parent | ed11e05d5b6463f582dc22140794837e97796bf9 (diff) |
m_spanningtree Strip membership id from KICKs sent to 1202 protocol servers
Diffstat (limited to 'src/modules')
-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 cb3af8a26..9d3c52bd2 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -226,6 +226,24 @@ void TreeSocket::WriteLine(const std::string& original_line) line.erase(colon); } } + else if (command == "KICK") + { + // Strip membership id if the KICK has one + 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 < line.size()-1) && (original_line[d+1] != ':')) + { + // There is a third parameter which doesn't begin with a colon, erase it + std::string::size_type e = line.find(' ', d + 1); + line.erase(d, e-d); + } + } } ServerInstance->Logs->Log(MODNAME, LOG_RAWIO, "S[%d] O %s", this->GetFd(), line.c_str()); this->WriteData(line); |