X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fmain.cpp;h=3c82d9de0204a5f9843053403cd140120930f717;hb=36f93c0e7f8a980943237b0b28138ade86f5e573;hp=456d0f5aa1f8b408b19ab22f78e431a139506016;hpb=fd0fa86da89ab4cefa778307088ef2552a05a170;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 456d0f5aa..3c82d9de0 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -50,6 +50,8 @@ SpanningTreeCommands::SpanningTreeCommands(ModuleSpanningTree* module) void ModuleSpanningTree::init() { + ServerInstance->SNO->EnableSnomask('l', "LINK"); + Utils = new SpanningTreeUtilities(this); commands = new SpanningTreeCommands(this); ServerInstance->Modules->AddService(commands->rconnect); @@ -116,8 +118,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) else if ((Current->Hidden) && (!user->IsOper())) return; - std::string servername = Current->GetName(); - user->WriteNumeric(364, "%s %s %s :%d %s", user->nick.c_str(), servername.c_str(), + user->WriteNumeric(364, "%s %s %s :%d %s", user->nick.c_str(), Current->GetName().c_str(), (Utils->FlatLinks && (!user->IsOper())) ? ServerInstance->Config->ServerName.c_str() : Parent.c_str(), (Utils->FlatLinks && (!user->IsOper())) ? 0 : hops, Current->GetDesc().c_str()); @@ -213,8 +214,7 @@ restart: if ((Utils->PingWarnTime) && (!s->Warned) && (curtime >= s->NextPingTime() - (Utils->PingFreq - Utils->PingWarnTime)) && (!s->AnsweredLastPing())) { /* The server hasnt responded, send a warning to opers */ - std::string servername = s->GetName(); - ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not responded to PING for %d seconds, high latency.", servername.c_str(), Utils->PingWarnTime); + ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not responded to PING for %d seconds, high latency.", s->GetName().c_str(), Utils->PingWarnTime); s->Warned = true; } } @@ -410,8 +410,7 @@ ModResult ModuleSpanningTree::HandleConnect(const std::vector& para } else { - std::string servername = CheckDupe->GetParent()->GetName(); - RemoteMessage(user, "*** CONNECT: Server \002%s\002 already exists on the network and is connected via \002%s\002", x->Name.c_str(), servername.c_str()); + RemoteMessage(user, "*** CONNECT: Server \002%s\002 already exists on the network and is connected via \002%s\002", x->Name.c_str(), CheckDupe->GetParent()->GetName().c_str()); return MOD_RES_DENY; } } @@ -670,7 +669,7 @@ 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("remoterehash", LOG_DEBUG, "called with param %s", parameter.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "OnPreRehash called with param %s", parameter.c_str()); // Send out to other servers if (!parameter.empty() && parameter[0] != '-')