X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fijoin.cpp;h=3d83a61de60d49e67dc8967b192892a9574e004d;hb=3151d60c1ecc9462e4c335282ee6c31672f45111;hp=78e05db93fbb841090e5c18257bcdf9ecd42a2f7;hpb=8f5efbc7aa33b792e02d01e3288f553e6e98ccaa;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/ijoin.cpp b/src/modules/m_spanningtree/ijoin.cpp index 78e05db93..3d83a61de 100644 --- a/src/modules/m_spanningtree/ijoin.cpp +++ b/src/modules/m_spanningtree/ijoin.cpp @@ -1,7 +1,9 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2012-2013 Attila Molnar + * Copyright (C) 2019 Robby + * Copyright (C) 2013-2014, 2016 Attila Molnar + * Copyright (C) 2013, 2018 Sadie Powell * * 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 @@ -23,14 +25,14 @@ #include "treeserver.h" #include "treesocket.h" -CmdResult CommandIJoin::HandleRemote(RemoteUser* user, std::vector& 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); @@ -38,12 +40,10 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, std::vector& } 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; @@ -57,7 +57,7 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, std::vector& return CMD_SUCCESS; } -CmdResult CommandResync::HandleServer(TreeServer* server, std::vector& params) +CmdResult CommandResync::HandleServer(TreeServer* server, CommandBase::Params& params) { ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Resyncing " + params[0]); Channel* chan = ServerInstance->FindChan(params[0]);