- return this->Admin(prefix, params);
- }
- else if (command == "MAP")
- {
- User* user = ServerInstance->FindNick(prefix);
- if (user)
- {
- std::vector<std::string> p(params.begin(), params.end());
- return Utils->Creator->HandleMap(p, user);
- }
- }
- else if (command == "SERVER")
- {
- return this->RemoteServer(prefix,params);
- }
- else if (command == "ERROR")
- {
- return this->Error(params);
- }
- else if (command == "OPERTYPE")
- {
- return this->OperType(prefix,params);
- }
- else if (command == "FMODE")
- {
- return this->ForceMode(prefix,params);
- }
- else if (command == "FTOPIC")
- {
- return this->ForceTopic(prefix,params);
- }
- else if (command == "METADATA")
- {
- return this->MetaData(prefix,params);
- }
- else if (command == "PING")
- {
- return this->LocalPing(prefix,params);
- }
- else if (command == "PONG")
- {
- TreeServer *s = Utils->FindServer(prefix);
- if (s && s->bursting)
- {
- ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not finished burst, forcing end of burst (send ENDBURST!)", prefix.c_str());
- s->FinishBurst();
- }
- return this->LocalPong(prefix,params);
- }
- else if (command == "VERSION")
- {
- return this->ServerVersion(prefix,params);
- }
- else if (command == "FHOST")
- {
- return this->ChangeHost(prefix,params);
- }
- else if (command == "FNAME")
- {
- return this->ChangeName(prefix,params);
- }
- else if (command == "ADDLINE")
- {
- return this->AddLine(prefix,params);
- }
- else if (command == "DELLINE")
- {
- return this->DelLine(prefix,params);
- }
- else if (command == "SVSNICK")
- {
- return this->ForceNick(prefix,params);
- }
- else if (command == "OPERQUIT")
- {
- return this->OperQuit(prefix,params);
- }
- else if (command == "IDLE")
- {
- return this->Whois(prefix,params);
- }
- else if (command == "PUSH")
- {
- return this->Push(prefix,params);
- }
- else if (command == "TIME")
- {
- return this->Time(prefix,params);
- }
- else if ((command == "KICK") && (Utils->IsServer(prefix)))
- {
- if (params.size() == 3)
- {
- TreeServer* pf = Utils->FindServer(prefix);
- if (pf)
- {
- irc::commasepstream nicks(params[1]);
- std::string nick;
- Channel* chan = this->ServerInstance->FindChan(params[0]);
- if (chan)
- {
- while (nicks.GetToken(nick))
- {
- User* user = this->ServerInstance->FindNick(nick);
- if (user)
- {
- if (!chan->ServerKickUser(user, params[2].c_str(), pf->GetName().c_str()))
- /* Yikes, the channels gone! */
- delete chan;
- }
- }
- }
- }
- }
-
- return Utils->DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params);
- }
- else if (command == "SVSJOIN")
- {
- return this->ServiceJoin(prefix,params);
- }
- else if (command == "SVSPART")
- {
- return this->ServicePart(prefix,params);
- }
- else if (command == "SQUIT")
- {
- if (params.size() == 2)
- {
- this->Squit(Utils->FindServer(params[0]),params[1]);
- }
- return true;
- }
- else if (command == "MODENOTICE")
- {
- if (params.size() >= 2)
- {
- if (ServerSource)
- ServerInstance->Users->WriteMode(params[0].c_str(), WM_AND, "*** From %s: %s", (ServerSource ? ServerSource->GetName().c_str() : prefix.c_str()), params[1].c_str());
- }
- return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params);
- }
- else if (command == "SNONOTICE")
- {
- if (params.size() >= 2)
- {
- std::string oldprefix;
- if (!ServerSource)
- {
- oldprefix = prefix;
- User *u = ServerInstance->FindNick(prefix);
- if (!u)
- return true;
- prefix = u->nick;
- }
-
- ServerInstance->SNO->WriteToSnoMask(*(params[0].c_str()), "From " + (ServerSource ? ServerSource->GetName().c_str() : prefix) + ": "+ params[1]);
- prefix = oldprefix;
- return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params);
- }
-
- }
- else if (command == "BURST")
- {
- // Set prefix server as bursting
- if (!ServerSource)
- {
- this->ServerInstance->SNO->WriteToSnoMask('l', "WTF: Got BURST from a nonexistant server(?): %s", (ServerSource ? ServerSource->GetName().c_str() : prefix.c_str()));
- return false;
- }
-
- ServerSource->bursting = true;
- return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params);
- }
- else if (command == "ENDBURST")
- {
- if (!ServerSource)
- {
- this->ServerInstance->SNO->WriteToSnoMask('l', "WTF: Got ENDBURST from a nonexistant server(?): %s", (ServerSource ? ServerSource->GetName().c_str() : prefix.c_str()));
- return false;
- }
-
- ServerSource->FinishBurst();
- return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params);
- }
- else if (command == "ENCAP")
- {
- return this->Encap(prefix, params);
- }
- else if (command == "MODE" && !this->ServerInstance->FindUUID(prefix)) // XXX we should check for no such serv?
- {
- // Server-prefix MODE.
- std::vector<std::string> modelist(params.begin(), params.end());
-
- /* We don't support this for channel mode changes any more! */
- if (params.size() >= 1)
- {
- if (ServerInstance->FindChan(params[0]))
- {
- this->SendError("Protocol violation by '"+(ServerSource ? ServerSource->GetName().c_str() : prefix)+"'! MODE for channel mode changes is not supported by the InspIRCd 1.2 protocol. You must use FMODE to preserve channel timestamps.");
- return false;
- }
- }
-
- // Insert into the parser
- this->ServerInstance->SendMode(modelist, this->ServerInstance->FakeClient);