summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-30 14:14:46 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-30 14:14:46 +0200
commitefb7084f4970b3703be1cef22c5930cc6a49454d (patch)
tree490ea821ae8735e5281ba5218dd992a48d853a6b /src
parent0ab057beca7de5d4ce331c34ca1e3bda30d9433a (diff)
m_spanningtree Translate user mode changes done via FMODE by 1202-protocol servers to MODE
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/compat.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp
index 724a5ced9..0f55793f1 100644
--- a/src/modules/m_spanningtree/compat.cpp
+++ b/src/modules/m_spanningtree/compat.cpp
@@ -415,6 +415,23 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std:
params.back().append(who->uuid);
who = TreeServer::Get(who)->ServerUser;
}
+ else if ((cmd == "FMODE") && (params.size() >= 2))
+ {
+ // Translate user mode changes with timestamp to MODE
+ if (params[0][0] != '#')
+ {
+ User* user = ServerInstance->FindUUID(params[0]);
+ if (!user)
+ return false;
+
+ // Emulate the old nonsensical behavior
+ if (user->age < ServerCommand::ExtractTS(params[1]))
+ return false;
+
+ cmd = "MODE";
+ params.erase(params.begin()+1);
+ }
+ }
return true; // Passthru
}