+ /* First up, apply their channel modes if they won the TS war */
+ if (apply_other_sides_modes)
+ {
+ std::vector<std::string> modelist;
+ modelist.push_back(channel);
+
+ /* Remember, params[params.size() - 1] is userlist, and we don't want to apply *that* */
+ modelist.insert(modelist.end(), params.begin()+2, params.end()-1);
+ ServerInstance->Modes->Process(modelist, srcuser, ModeParser::MODE_LOCALONLY | ModeParser::MODE_MERGE);
+ }
+
+ irc::modestacker modestack(true);
+ TreeSocket* src_socket = Utils->FindServer(srcuser->server)->GetRoute()->GetSocket();
+
+ /* Now, process every 'modes,uuid' pair */
+ irc::tokenstream users(*params.rbegin());
+ std::string item;
+ irc::modestacker* modestackptr = (apply_other_sides_modes ? &modestack : NULL);
+ while (users.GetToken(item))
+ {
+ if (!ProcessModeUUIDPair(item, src_socket, chan, modestackptr))
+ return CMD_INVALID;
+ }
+