diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-30 14:07:51 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-30 14:07:51 +0200 |
commit | 0ab057beca7de5d4ce331c34ca1e3bda30d9433a (patch) | |
tree | 72ec49ba27c233611ef10f50824bc97e0d0cae15 /src | |
parent | c1cc5cf147babcd834ba0dbbdd4b1c1d4ae010b6 (diff) |
m_spanningtree Accept legacy JOINs from 1202-protocol servers
2.0 accepted JOIN and some pseudoservers might use it
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_spanningtree/compat.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index b9c7e6940..724a5ced9 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -401,6 +401,20 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std: cmd = "SINFO"; params.insert(params.begin(), "version"); } + else if (cmd == "JOIN") + { + // 2.0 allows and forwards legacy JOINs but we don't, so translate them to FJOINs before processing + if ((params.size() != 1) || (IS_SERVER(who))) + return false; // Huh? + + cmd = "FJOIN"; + Channel* chan = ServerInstance->FindChan(params[0]); + params.push_back(ConvToStr(chan ? chan->age : ServerInstance->Time())); + params.push_back("+"); + params.push_back(","); + params.back().append(who->uuid); + who = TreeServer::Get(who)->ServerUser; + } return true; // Passthru } |