summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-17 13:39:08 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-17 13:39:08 +0200
commitc3aa3125dd016c7952d9f9d4279ed7a5b3f542ec (patch)
treed60f6bee7fb535bc0a1dca59df2fbea1b0131bcd /src
parent92bc6a513b12fd2b4425aac6c93ccb82c15d611f (diff)
m_spanningtree Translate SINFO version to VERSION and vice versa for 1202 protocol servers
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/compat.cpp20
1 files changed, 19 insertions, 1 deletions
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
}