summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-10 10:16:29 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-10 10:16:29 +0000
commit3eca7be9df4d4712a28645f247b389c10efbf7ca (patch)
tree488ea35e8f9c06c66e82961cae1848b0663d33be
parentf27e18aafc1bb0247200f6dcdd957f09772ee093 (diff)
If hidewhois is enabled, don't show idle time unless requested via remote /whois nick nick form, this stops serverhopping to find where someone is. Thanks djGrrr.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6945 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/cmd_whois.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cmd_whois.cpp b/src/cmd_whois.cpp
index 4b7c3807d..f45a48c6a 100644
--- a/src/cmd_whois.cpp
+++ b/src/cmd_whois.cpp
@@ -67,13 +67,20 @@ void do_whois(InspIRCd* ServerInstance, userrec* user, userrec* dest,unsigned lo
if (!strcasecmp(user->server,dest->server))
{
- // idle time and signon line can only be sent if youre on the same server (according to RFC)
- ServerInstance->SendWhoisLine(user, dest, 317, "%s %s %d %d :seconds idle, signon time",user->nick, dest->nick, abs((dest->idle_lastmsg)-ServerInstance->Time()), dest->signon);
+ // the user is on the same server as us, so we already know their idle time.
+ // check we're not hiding whois, though, as otherwise we give away what server they are on.
+ if (!*ServerInstance->Config->HideWhoisServer)
+ {
+ ServerInstance->SendWhoisLine(user, dest, 317, "%s %s %d %d :seconds idle, signon time",user->nick, dest->nick, abs((dest->idle_lastmsg)-ServerInstance->Time()), dest->signon);
+ }
}
else
{
if ((idle) || (signon))
+ {
+ // if we get here, m_spanningtree has called us, so it's remote
ServerInstance->SendWhoisLine(user, dest, 317, "%s %s %d %d :seconds idle, signon time",user->nick, dest->nick, idle, signon);
+ }
}
ServerInstance->SendWhoisLine(user, dest, 318, "%s %s :End of /WHOIS list.",user->nick, dest->nick);
}