/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2012-2013 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2013-2014, 2016 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public
#include "treeserver.h"
#include "treesocket.h"
-CmdResult CommandIJoin::HandleRemote(RemoteUser* user, std::vector<std::string>& params)
+CmdResult CommandIJoin::HandleRemote(RemoteUser* user, Params& params)
{
Channel* chan = ServerInstance->FindChan(params[0]);
if (!chan)
{
// Desync detected, recover
// Ignore the join and send RESYNC, this will result in the remote server sending all channel data to us
- ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Received IJOIN for non-existant channel: " + params[0]);
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Received IJOIN for nonexistent channel: " + params[0]);
CmdBuilder("RESYNC").push(params[0]).Unicast(user);
}
bool apply_modes;
- if (params.size() > 2)
+ if (params.size() > 3)
{
time_t RemoteTS = ServerCommand::ExtractTS(params[2]);
- if (RemoteTS < chan->age)
- throw ProtocolException("Attempted to lower TS via IJOIN. LocalTS=" + ConvToStr(chan->age));
- apply_modes = ((params.size() > 3) && (RemoteTS == chan->age));
+ apply_modes = (RemoteTS <= chan->age);
}
else
apply_modes = false;
return CMD_SUCCESS;
}
-CmdResult CommandResync::HandleServer(TreeServer* server, std::vector<std::string>& params)
+CmdResult CommandResync::HandleServer(TreeServer* server, CommandBase::Params& params)
{
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Resyncing " + params[0]);
Channel* chan = ServerInstance->FindChan(params[0]);