From d8531d95ac32a7863a85f41589cd96f174648120 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 5 Apr 2008 17:27:22 +0000 Subject: Fix showing of sid/uid instead of nick or servername when lines are added git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9361 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/addline.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/addline.cpp b/src/modules/m_spanningtree/addline.cpp index ec518376f..b7f2ad420 100644 --- a/src/modules/m_spanningtree/addline.cpp +++ b/src/modules/m_spanningtree/addline.cpp @@ -30,9 +30,20 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque &par XLineFactory* xlf = Instance->XLines->GetFactory(params[0]); + std::string setter = ""; + User* usr = Instance->FindNick(prefix); + if (usr) + setter = usr->nick; + else + { + TreeServer* t = Utils->FindServer(prefix); + if (t) + setter = t->GetName().c_str(); + } + if (!xlf) { - this->Instance->SNO->WriteToSnoMask('x',"%s sent me an unknown ADDLINE type (%s).",prefix.c_str(),params[0].c_str()); + this->Instance->SNO->WriteToSnoMask('x',"%s sent me an unknown ADDLINE type (%s).",setter.c_str(),params[0].c_str()); return true; } @@ -42,12 +53,12 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque &par { if (xl->duration) { - this->Instance->SNO->WriteToSnoMask('x',"%s added %s%s on %s to expire on %s (%s).",prefix.c_str(),params[0].c_str(),params[0].length() == 1 ? "LINE" : "", + this->Instance->SNO->WriteToSnoMask('x',"%s added %s%s on %s to expire on %s (%s).",setter.c_str(),params[0].c_str(),params[0].length() == 1 ? "LINE" : "", params[1].c_str(),Instance->TimeString(xl->expiry).c_str(),params[5].c_str()); } else { - this->Instance->SNO->WriteToSnoMask('x',"%s added permanent %s%s on %s (%s).",prefix.c_str(),params[0].c_str(),params[0].length() == 1 ? "LINE" : "", + this->Instance->SNO->WriteToSnoMask('x',"%s added permanent %s%s on %s (%s).",setter.c_str(),params[0].c_str(),params[0].length() == 1 ? "LINE" : "", params[1].c_str(),params[5].c_str()); } params[5] = ":" + params[5]; @@ -55,7 +66,7 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque &par User* u = Instance->FindNick(prefix); Utils->DoOneToAllButSender(prefix, "ADDLINE", params, u ? u->server : prefix); TreeServer *remoteserver = Utils->FindServer(u ? u->server : prefix); - + if (!remoteserver->bursting) { Instance->XLines->ApplyLines(); -- cgit v1.2.3