X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Ffmode.cpp;h=c3eaa7afa4ee68a272d2c09a53cb1d2bcf38c8c5;hb=dcafba95960685120b1f6d902de623ca10ed6135;hp=56757a8b73f989757350a8f0e2d8758b8df2264e;hpb=f62654a6859998f9d63eb22702c572d5ebcff15c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/fmode.cpp b/src/modules/m_spanningtree/fmode.cpp index 56757a8b7..c3eaa7afa 100644 --- a/src/modules/m_spanningtree/fmode.cpp +++ b/src/modules/m_spanningtree/fmode.cpp @@ -1,7 +1,11 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2009-2010 Daniel De Graaf + * Copyright (C) 2018 Sadie Powell + * Copyright (C) 2012-2015 Attila Molnar + * Copyright (C) 2012 Robby + * Copyright (C) 2010 Daniel De Graaf + * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2008 Robin Burchell * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -21,8 +25,8 @@ #include "inspircd.h" #include "commands.h" -/** FMODE command - server mode with timestamp checks */ -CmdResult CommandFMode::Handle(User* who, std::vector& params) +/** FMODE command - channel mode change with timestamp checks */ +CmdResult CommandFMode::Handle(User* who, Params& params) { time_t TS = ServerCommand::ExtractTS(params[1]); @@ -39,18 +43,17 @@ CmdResult CommandFMode::Handle(User* who, std::vector& params) if (TS > ourTS) return CMD_FAILURE; - /* TS is equal or less: Merge the mode changes into ours and pass on. + /* TS is equal or less: apply the mode change locally and forward the message */ - std::vector modelist; - modelist.reserve(params.size()-1); - /* Insert everything into modelist except the TS (params[1]) */ - modelist.push_back(params[0]); - modelist.insert(modelist.end(), params.begin()+2, params.end()); + + // Turn modes into a Modes::ChangeList; may have more elements than max modes + Modes::ChangeList changelist; + ServerInstance->Modes.ModeParamsToChangeList(who, MODETYPE_CHANNEL, params, changelist, 2); ModeParser::ModeProcessFlag flags = ModeParser::MODE_LOCALONLY; if ((TS == ourTS) && IS_SERVER(who)) flags |= ModeParser::MODE_MERGE; - ServerInstance->Modes->Process(modelist, who, flags); + ServerInstance->Modes->Process(who, chan, NULL, changelist, flags); return CMD_SUCCESS; }