#include "resolvers.h"
/* Handle ERROR command */
-bool TreeSocket::Error(parameterlist ¶ms)
+void TreeSocket::Error(parameterlist ¶ms)
{
- if (params.size() < 1)
- return false;
- ServerInstance->SNO->WriteGlobalSno('l',"ERROR from %s: %s",(!InboundServerName.empty() ? InboundServerName.c_str() : myhost.c_str()),params[0].c_str());
- /* we will return false to cause the socket to close. */
- return false;
+ std::string msg = params.size() ? params[0] : "";
+ SetError("received ERROR " + msg);
}
void TreeSocket::Split(const std::string& line, std::string& prefix, std::string& command, parameterlist& params)
if (ServerSource)
{
- who = Utils->ServerUser;
- Utils->ServerUser->SetFakeServer(ServerSource->GetName());
- Utils->ServerUser->uuid = ServerSource->GetID();
+ who = ServerSource->ServerUser;
direction = prefix;
}
else
}
else if (command == "FJOIN")
{
- this->ForceJoin(prefix,params);
+ this->ForceJoin(who,params);
}
else if (command == "STATS")
{
}
else if (command == "FMODE")
{
- this->ForceMode(prefix,params);
+ this->ForceMode(who,params);
}
else if (command == "FTOPIC")
{
this->Squit(Utils->FindServer(params[0]),params[1]);
}
}
- else if (command == "MODENOTICE")
- {
- if (params.size() >= 2)
- {
- ServerInstance->Users->WriteMode(params[0].c_str(), WM_AND, "*** From %s: %s",
- who->nick.c_str(), params[1].c_str());
- }
- Utils->DoOneToAllButSender(prefix, command, params, prefix);
- }
else if (command == "SNONOTICE")
{
if (params.size() >= 2)
{
- ServerInstance->SNO->WriteGlobalSno(*(params[0].c_str()), "From " + who->nick + ": "+ params[1]);
+ ServerInstance->SNO->WriteToSnoMask(*(params[0].c_str()), "From " + who->nick + ": "+ params[1]);
Utils->DoOneToAllButSender(prefix, command, params, prefix);
}
}
else if (command == "BURST")
{
// Set prefix server as bursting
- if (!IS_SERVER(who))
+ TreeServer* ServerSource = Utils->FindServer(prefix);
+ if (!ServerSource)
{
ServerInstance->SNO->WriteGlobalSno('l', "WTF: Got BURST from a non-server(?): %s", prefix.c_str());
return;
}
- route_back_again->bursting = true;
+ ServerSource->bursting = true;
Utils->DoOneToAllButSender(prefix, command, params, prefix);
}
else if (command == "ENDBURST")
}
else if (command == "ENCAP")
{
- this->Encap(prefix, params);
+ this->Encap(who, params);
}
else if (command == "NICK")
{