From 2e065eac65004b6f0bcdaf2f9d5eb3396a745f59 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 4 Sep 2014 12:31:56 +0200 Subject: m_spanningtree Simplify processing non-prefix modes in FJOINs Use ModeParser::ModeParamsToChangeList() instead of duplicating logic --- src/modules/m_spanningtree/fjoin.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index 99f174a97..bfe3592d2 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -116,24 +116,7 @@ CmdResult CommandFJoin::Handle(User* srcuser, std::vector& params) Modes::ChangeList modechangelist; if (apply_other_sides_modes) { - std::vector::const_iterator paramit = params.begin() + 3; - const std::vector::const_iterator lastparamit = ((params.size() > 3) ? (params.end() - 1) : params.end()); - for (std::string::const_iterator i = params[2].begin(); i != params[2].end(); ++i) - { - ModeHandler* mh = ServerInstance->Modes->FindMode(*i, MODETYPE_CHANNEL); - if (!mh) - continue; - - std::string modeparam; - if ((paramit != lastparamit) && (mh->GetNumParams(true))) - { - modeparam = *paramit; - ++paramit; - } - - modechangelist.push_add(mh, modeparam); - } - + ServerInstance->Modes.ModeParamsToChangeList(srcuser, MODETYPE_CHANNEL, params, modechangelist, 2, params.size() - 1); ServerInstance->Modes->Process(srcuser, chan, NULL, modechangelist, ModeParser::MODE_LOCALONLY | ModeParser::MODE_MERGE); // Reuse for prefix modes modechangelist.clear(); -- cgit v1.2.3