From 3fb563bb438124206d605d9ecb35a0569ec99b17 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 12 Jul 2017 07:23:00 -0700 Subject: [PATCH] inspircd: get rid of IDLE->WHOIS hack This is unnecessary as sending 0 for both the idle time and signon time will tell the IRCd to not show anything. ...But we track our startup time, so we can actually pass that as a value (Anope does this as well) --- protocols/inspircd.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index d0663ef..469c8f4 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -606,24 +606,15 @@ class InspIRCdProtocol(TS6BaseProtocol): return {'target': channel, 'modes': changedmodes, 'ts': ts, 'channeldata': oldobj} - def handle_idle(self, numeric, command, args): + def handle_idle(self, source, command, args): """ Handles the IDLE command, sent between servers in remote WHOIS queries. """ # <- :70MAAAAAA IDLE 1MLAAAAIG # -> :1MLAAAAIG IDLE 70MAAAAAA 1433036797 319 - sourceuser = numeric - targetuser = args[0] - # HACK: make PyLink handle the entire WHOIS request. - # This works by silently ignoring the idle time request, and sending our WHOIS data as - # raw numerics instead. - # The rationale behind this is that PyLink cannot accurately track signon and idle times for - # things like relay users, without forwarding WHOIS requests between servers in a way the - # hooks system is really not optimized to do. However, no IDLE response means that no WHOIS - # data is ever sent back to the calling user, so this workaround is probably the best - # solution (aside from faking values). -GLolol - return {'target': args[0], 'parse_as': 'WHOIS'} + # First arg = source, second = signon time, third = idle time + self._send_with_prefix(args[0], 'IDLE %s %s 0' % (source, self.start_ts)) def handle_ftopic(self, numeric, command, args): """Handles incoming FTOPIC (sets topic on burst)."""