From 84452bec2ef2a7858e0283b667aac8c28efadd22 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 10 Jul 2016 21:55:16 -0700 Subject: [PATCH] inspircd: always make PyLink handle WHOIS (closes #267) This removes the use_experimental_whois option, which is always enabled now. 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. --- example-conf.yml | 7 ------- protocols/inspircd.py | 20 ++++++++++++-------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/example-conf.yml b/example-conf.yml index 8a0e213..6f3c252 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -132,13 +132,6 @@ servers: # This setting defaults to sha256. #ssl_fingerprint_type: sha256 - # The following option is specific to InspIRCd networks: - - # Force PyLink to handle WHOIS requests locally for all its clients - # (experimental). This is required if you want custom WHOIS handlers - # implemented by plugins like relay to work. Defaults to false. - #use_experimental_whois: false - ts6net: ip: ::1 diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 89d6e28..9bf228c 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -608,19 +608,23 @@ class InspIRCdProtocol(TS6BaseProtocol): return {'target': target, 'modes': changedmodes} def handle_idle(self, numeric, command, args): - """Handles the IDLE command, sent between servers in remote WHOIS queries.""" + """ + Handles the IDLE command, sent between servers in remote WHOIS queries. + """ # <- :70MAAAAAA IDLE 1MLAAAAIG # -> :1MLAAAAIG IDLE 70MAAAAAA 1433036797 319 sourceuser = numeric targetuser = args[0] - if self.irc.serverdata.get("use_experimental_whois"): - # EXPERIMENTAL HACK: make PyLink handle all WHOIS requests if configured to do so. - # This works by silently ignoring the idle time request, and sending our WHOIS data as - # raw numerics instead. - return {'target': args[0], 'parse_as': 'WHOIS'} - else: - self._send(targetuser, 'IDLE %s %s 0' % (sourceuser, self.irc.users[targetuser].ts)) + # 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'} def handle_ftopic(self, numeric, command, args): """Handles incoming FTOPIC (sets topic on burst)."""