summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-09-04 12:31:56 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-09-04 12:31:56 +0200
commit2e065eac65004b6f0bcdaf2f9d5eb3396a745f59 (patch)
tree114c5809600d5ed388cbe662bef57b51ce12850d /src/modules
parent48cf43d0aba330bacb5dc0122f0f9d247c2db0b7 (diff)
m_spanningtree Simplify processing non-prefix modes in FJOINs
Use ModeParser::ModeParamsToChangeList() instead of duplicating logic
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/fjoin.cpp19
1 files changed, 1 insertions, 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<std::string>& params)
Modes::ChangeList modechangelist;
if (apply_other_sides_modes)
{
- std::vector<std::string>::const_iterator paramit = params.begin() + 3;
- const std::vector<std::string>::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();