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();
ServerInstance->Modes->Process(ServerInstance->FakeClient, c, NULL, changelist, ModeParser::MODE_LOCALONLY);
}
-void CommandFJoin::ApplyModeStack(User* srcuser, Channel* c, irc::modestacker& stack)
-{
- parameterlist stackresult;
- stackresult.push_back(c->name);
-
- while (stack.GetStackedLine(stackresult))
- {
- ServerInstance->Modes->Process(stackresult, srcuser, ModeParser::MODE_LOCALONLY);
- stackresult.erase(stackresult.begin() + 1, stackresult.end());
- }
-}
-
void CommandFJoin::LowerTS(Channel* chan, time_t TS, const std::string& newname)
{
if (Utils->AnnounceTSChange)