summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmd_whois.cpp3
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp2
2 files changed, 4 insertions, 1 deletions
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<std::string> &param
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
{