From 49e69fa6f5609cf87daac502fc10727fc5fe3fa5 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 4 May 2007 14:50:34 +0000 Subject: Apply visibility state to whois, next stop, /who git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6869 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_whois.cpp | 3 ++- src/modules/m_spanningtree/treesocket2.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmd_whois.cpp b/src/cmd_whois.cpp index 192e2822c..9be4a68ca 100644 --- a/src/cmd_whois.cpp +++ b/src/cmd_whois.cpp @@ -21,7 +21,7 @@ void do_whois(InspIRCd* ServerInstance, userrec* user, userrec* dest,unsigned long signon, unsigned long idle, const char* nick) { /* check if the user is registered first, can't whois unknown connections */ - if (dest->registered == REG_ALL) + if ((dest->registered == REG_ALL) && ((dest->Visibility && !dest->Visibility->VisibleTo(user)))) { ServerInstance->SendWhoisLine(user, dest, 311, "%s %s %s %s * :%s",user->nick, dest->nick, dest->ident, dest->dhost, dest->fullname); if ((user == dest) || (*user->oper)) @@ -92,6 +92,7 @@ CmdResult cmd_whois::Handle (const char** parameters, int pcnt, userrec *user) return CMD_SUCCESS; dest = ServerInstance->FindNick(parameters[0]); + if (dest) { do_whois(this->ServerInstance, user,dest,0,0,parameters[0]); diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 397a7c0b0..4b4cdff8e 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -632,7 +632,9 @@ bool TreeSocket::Whois(const std::string &prefix, std::deque ¶m unsigned long signon = atoi(params[1].c_str()); unsigned long idle = atoi(params[2].c_str()); if ((who_to_send_to) && (IS_LOCAL(who_to_send_to))) + { do_whois(this->Instance, who_to_send_to, u, signon, idle, nick_whoised.c_str()); + } } else { -- cgit v1.2.3