bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std::vector<std::string>& params)
{
- if ((cmd == "METADATA") && (params.size() >= 3))
+ if ((cmd == "METADATA") && (params.size() >= 3) && (params[0][0] == '#'))
{
// :20D METADATA #channel extname :extdata
return InsertCurrentChannelTS(params);
params.swap(p);
}
+ else if (cmd == "SVSMODE")
+ {
+ cmd = "MODE";
+ }
return true; // Passthru
}
return;
}
- /*
- * First up, check for any malformed commands (e.g. MODE without a timestamp)
- * and rewrite commands where necessary (SVSMODE -> MODE for services). -- w
- */
- if (command == "SVSMODE") // This isn't in an "else if" so we still force FMODE for changes on channels.
- command = "MODE";
-
+ // Translate commands coming from servers using an older protocol
if (proto_version < ProtocolVersion)
{
if (!PreProcessOldProtocolMessage(who, command, params))