X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fmain.cpp;h=01387c753c85ca7b68e476ac9bc771574ce7ef28;hb=56b4dc61e49e4218544f51ac9a25ab3ece60a782;hp=1aab60edaac41b9e2bfdb6a4e4a744c9e4abc6ab;hpb=aa692dc1039b63deef7886e914ec499abe7facaf;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 1aab60eda..01387c753 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz * Copyright (C) 2019 linuxdaemon * Copyright (C) 2013, 2017-2020 Sadie Powell * Copyright (C) 2013, 2016 Adam @@ -135,7 +136,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) ShowLinks(server, user, hops+1); } } - /* Don't display the line if its a uline, hide ulines is on, and the user isnt an oper */ + /* Don't display the line if its a uline, hide ulines is on, and the user isn't an oper */ if ((Utils->HideULines) && (Current->IsULine()) && (!user->IsOper())) return; /* Or if the server is hidden and they're not an oper */ @@ -143,7 +144,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) return; user->WriteNumeric(RPL_LINKS, Current->GetName(), - (((Utils->FlatLinks) && (!user->IsOper())) ? ServerInstance->Config->ServerName : Parent), + (((Utils->FlatLinks) && (!user->IsOper())) ? ServerInstance->Config->GetServerName() : Parent), InspIRCd::Format("%d %s", (((Utils->FlatLinks) && (!user->IsOper())) ? 0 : hops), Current->GetDesc().c_str())); } @@ -215,17 +216,13 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y) // If this fails then the IP sa will be AF_UNSPEC. irc::sockets::aptosa(x->IPAddr, x->Port, sa); } - + /* Do we already have an IP? If so, no need to resolve it. */ if (sa.family() != AF_UNSPEC) { // Create a TreeServer object that will start connecting immediately in the background TreeSocket* newsocket = new TreeSocket(x, y, sa); - if (newsocket->GetFd() > -1) - { - /* Handled automatically on success */ - } - else + if (!newsocket->HasFd()) { ServerInstance->SNO->WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s.", x->Name.c_str(), newsocket->getError().c_str()); @@ -424,7 +421,7 @@ void ModuleSpanningTree::OnUserPostMessage(User* user, const MessageTarget& targ const std::string* serverglob = target.Get(); CmdBuilder par(user, message_type); par.push_tags(details.tags_out); - par.push(*serverglob); + par.push(std::string("$") + *serverglob); par.push_last(details.text); par.Broadcast(); break; @@ -461,7 +458,7 @@ void ModuleSpanningTree::OnUserPostTagMessage(User* user, const MessageTarget& t const std::string* serverglob = target.Get(); CmdBuilder par(user, "TAGMSG"); par.push_tags(details.tags_out); - par.push(*serverglob); + par.push(std::string("$") + *serverglob); par.Broadcast(); break; } @@ -824,7 +821,7 @@ ModuleSpanningTree::~ModuleSpanningTree() Version ModuleSpanningTree::GetVersion() { - return Version("Allows servers to be linked", VF_VENDOR); + return Version("Allows linking multiple servers together as part of one network.", VF_VENDOR); } /* It is IMPORTANT that m_spanningtree is the last module in the chain