From 3eca7be9df4d4712a28645f247b389c10efbf7ca Mon Sep 17 00:00:00 2001 From: w00t Date: Thu, 10 May 2007 10:16:29 +0000 Subject: 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 --- src/cmd_whois.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/cmd_whois.cpp') 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); } -- cgit v1.2.3