#include "treesocket.h"
/** FJOIN, almost identical to TS6 SJOIN, except for nicklist handling. */
-CmdResult CommandFJoin::Handle(const std::vector<std::string>& params, User *srcuser)
+CmdResult CommandFJoin::Handle(User* srcuser, std::vector<std::string>& params)
{
- SpanningTreeUtilities* Utils = ((ModuleSpanningTree*)(Module*)creator)->Utils;
/* 1.1+ FJOIN works as follows:
*
* Each FJOIN is sent along with a timestamp, and the side with the lowest
time_t TS = ConvToInt(params[1]);
if (!TS)
{
- ServerInstance->Logs->Log("m_spanningtree",LOG_DEFAULT,"*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
+ ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
ServerInstance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FJOIN with a TS of zero. Total craq. Command was dropped.", srcuser->server.c_str());
return CMD_INVALID;
}
/* 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->SendMode(modelist, srcuser);
+ ServerInstance->Modes->Process(modelist, srcuser, ModeParser::MODE_LOCALONLY | ModeParser::MODE_MERGE);
}
irc::modestacker modestack(true);
- TreeSocket* src_socket = Utils->FindServer(srcuser->server)->GetRoute()->GetSocket();
+ TreeSocket* src_socket = Utils->FindServer(srcuser->server)->GetSocket();
/* Now, process every 'modes,uuid' pair */
irc::tokenstream users(*params.rbegin());
}
/* Check that the user's 'direction' is correct */
- SpanningTreeUtilities* Utils = ((ModuleSpanningTree*)(Module*)creator)->Utils;
TreeServer* route_back_again = Utils->BestRouteTo(who->server);
if ((!route_back_again) || (route_back_again->GetSocket() != src_socket))
{
* for this function we require tidyness instead. Fixes bug #493
*/
if (mh)
- mh->RemoveMode(c, &stack);
+ mh->RemoveMode(c, stack);
}
ApplyModeStack(ServerInstance->FakeClient, c, stack);
while (stack.GetStackedLine(stackresult))
{
- ServerInstance->SendMode(stackresult, srcuser);
+ ServerInstance->Modes->Process(stackresult, srcuser, ModeParser::MODE_LOCALONLY);
stackresult.erase(stackresult.begin() + 1, stackresult.end());
}
}