#include "translate.h"
ModuleSpanningTree::ModuleSpanningTree()
- : Stats::EventListener(this)
+ : Away::EventListener(this)
+ , Stats::EventListener(this)
, rconnect(this)
, rsquit(this)
, map(this)
, currmembid(0)
, eventprov(this, "event/server")
, DNS(this, "DNS")
+ , tagevprov(this, "event/messagetag")
, loopCall(false)
{
}
InspIRCd::Format("%d %s", (((Utils->FlatLinks) && (!user->IsOper())) ? 0 : hops), Current->GetDesc().c_str()));
}
-void ModuleSpanningTree::HandleLinks(const std::vector<std::string>& parameters, User* user)
+void ModuleSpanningTree::HandleLinks(const CommandBase::Params& parameters, User* user)
{
ShowLinks(Utils->TreeRoot,user,0);
user->WriteNumeric(RPL_ENDOFLINKS, '*', "End of /LINKS list.");
return;
}
+#ifndef _WIN32
if (x->IPAddr.find('/') != std::string::npos)
{
struct stat sb;
if (stat(x->IPAddr.c_str(), &sb) == -1 || !S_ISSOCK(sb.st_mode))
ipvalid = false;
}
+#endif
if (x->IPAddr.find(':') != std::string::npos)
{
in6_addr n;
}
}
-ModResult ModuleSpanningTree::HandleVersion(const std::vector<std::string>& parameters, User* user)
+ModResult ModuleSpanningTree::HandleVersion(const CommandBase::Params& parameters, User* user)
{
// We've already confirmed that !parameters.empty(), so this is safe
TreeServer* found = Utils->FindServerMask(parameters[0]);
return MOD_RES_DENY;
}
-ModResult ModuleSpanningTree::HandleConnect(const std::vector<std::string>& parameters, User* user)
+ModResult ModuleSpanningTree::HandleConnect(const CommandBase::Params& parameters, User* user)
{
for (std::vector<reference<Link> >::iterator i = Utils->LinkBlocks.begin(); i < Utils->LinkBlocks.end(); i++)
{
if (!IS_LOCAL(d))
{
CmdBuilder params(user, message_type);
+ params.push_tags(details.tags_out);
params.push_back(d->uuid);
params.push_last(details.text);
params.Unicast(d);
}
else if (target.type == MessageTarget::TYPE_CHANNEL)
{
- Utils->SendChannelMessage(user->uuid, target.Get<Channel>(), details.text, target.status, details.exemptions, message_type);
+ Utils->SendChannelMessage(user->uuid, target.Get<Channel>(), details.text, target.status, details.tags_out, details.exemptions, message_type);
}
else if (target.type == MessageTarget::TYPE_SERVER)
{
const std::string* serverglob = target.Get<std::string>();
CmdBuilder par(user, message_type);
+ par.push_tags(details.tags_out);
par.push_back(*serverglob);
par.push_last(details.text);
par.Broadcast();
CmdBuilder(user, "FHOST").push(newhost).Broadcast();
}
-void ModuleSpanningTree::OnChangeName(User* user, const std::string &gecos)
+void ModuleSpanningTree::OnChangeRealName(User* user, const std::string& real)
{
if (user->registered != REG_ALL || !IS_LOCAL(user))
return;
- CmdBuilder(user, "FNAME").push_last(gecos).Broadcast();
+ CmdBuilder(user, "FNAME").push_last(real).Broadcast();
}
void ModuleSpanningTree::OnChangeIdent(User* user, const std::string &ident)
void ModuleSpanningTree::OnPreRehash(User* user, const std::string ¶meter)
{
- if (loopCall)
- return; // Don't generate a REHASH here if we're in the middle of processing a message that generated this one
-
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "OnPreRehash called with param %s", parameter.c_str());
// Send out to other servers
params.Broadcast();
}
-ModResult ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg)
+void ModuleSpanningTree::OnUserAway(User* user)
{
if (IS_LOCAL(user))
- CommandAway::Builder(user, awaymsg).Broadcast();
+ CommandAway::Builder(user).Broadcast();
+}
- return MOD_RES_PASSTHRU;
+void ModuleSpanningTree::OnUserBack(User* user)
+{
+ if (IS_LOCAL(user))
+ CommandAway::Builder(user).Broadcast();
}
-void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::ChangeList& modes, ModeParser::ModeProcessFlag processflags, const std::string& output_mode)
+void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::ChangeList& modes, ModeParser::ModeProcessFlag processflags)
{
if (processflags & ModeParser::MODE_LOCALONLY)
return;
CmdBuilder params(source, "MODE");
params.push(u->uuid);
- params.push(output_mode);
+ params.push(ClientProtocol::Messages::Mode::ToModeLetters(modes));
params.push_raw(Translate::ModeChangeListToParams(modes.getlist()));
params.Broadcast();
}
CmdBuilder params(source, "FMODE");
params.push(c->name);
params.push_int(c->age);
- params.push(output_mode);
+ params.push(ClientProtocol::Messages::Mode::ToModeLetters(modes));
params.push_raw(Translate::ModeChangeListToParams(modes.getlist()));
params.Broadcast();
}