bool apply_modes;
if (params.size() > 1)
{
- time_t RemoteTS = ConvToInt(params[1]);
- if (!RemoteTS)
- {
- ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Invalid TS in IJOIN: " + params[1]);
- return CMD_INVALID;
- }
-
+ time_t RemoteTS = ServerCommand::ExtractTS(params[1]);
if (RemoteTS < chan->age)
- {
- ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Attempted to lower TS via IJOIN. Channel=" + params[0] + " RemoteTS=" + params[1] + " LocalTS=" + ConvToStr(chan->age));
- return CMD_INVALID;
- }
+ throw ProtocolException("Attempted to lower TS via IJOIN. LocalTS=" + ConvToStr(chan->age));
apply_modes = ((params.size() > 2) && (RemoteTS == chan->age));
}
else
}
if (!server->IsLocal())
- {
- ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Received RESYNC with a source that is not directly connected: " + server->GetID());
- return CMD_INVALID;
- }
+ throw ProtocolException("RESYNC from a server that is not directly connected");
// Send all known information about the channel
server->GetSocket()->SyncChannel(chan);