From c3aa3125dd016c7952d9f9d4279ed7a5b3f542ec Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 17 Jun 2014 13:39:08 +0200 Subject: m_spanningtree Translate SINFO version to VERSION and vice versa for 1202 protocol servers --- src/modules/m_spanningtree/compat.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 5893a09fd..b9c7e6940 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -246,7 +246,17 @@ void TreeSocket::WriteLine(const std::string& original_line) } else if (command == "SINFO") { - return; + // :22D SINFO version :InspIRCd-2.2 + // A B C + std::string::size_type c = line.find(' ', b + 1); + if (c == std::string::npos) + return; + + // Only translating SINFO version, discard everything else + if (line.compare(b, 9, " version ", 9)) + return; + + line = line.substr(0, 5) + "VERSION" + line.substr(c); } } ServerInstance->Logs->Log(MODNAME, LOG_RAWIO, "S[%d] O %s", this->GetFd(), line.c_str()); @@ -383,6 +393,14 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std: // Insert channel timestamp after the channel name; the 3rd parameter, if there, is the invite expiration time return InsertCurrentChannelTS(params, 1, 2); } + else if (cmd == "VERSION") + { + // :20D VERSION :InspIRCd-2.0 + // change to + // :20D SINFO version :InspIRCd-2.0 + cmd = "SINFO"; + params.insert(params.begin(), "version"); + } return true; // Passthru } -- cgit v1.2.3