diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-05 17:27:22 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-05 17:27:22 +0000 |
commit | d8531d95ac32a7863a85f41589cd96f174648120 (patch) | |
tree | 8df58b639143a020a555828a49d529c32e497c90 /src/modules | |
parent | caf0301c894d41aa04ceb685ef981d6292fecd2d (diff) |
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
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/addline.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
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<std::string> &par XLineFactory* xlf = Instance->XLines->GetFactory(params[0]); + std::string setter = "<unknown>"; + 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<std::string> &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<std::string> &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(); |