diff --git a/coremods/handlers.py b/coremods/handlers.py index 42d369d..182607b 100644 --- a/coremods/handlers.py +++ b/coremods/handlers.py @@ -99,7 +99,8 @@ def handle_whois(irc, source, command, args): f(335, source, "%s :is a bot" % nick) # :charybdis.midnight.vpn 317 GL GL 1946 1499867833 :seconds idle, signon time - f(317, source, "%s 0 %s :seconds idle (placeholder), signon time" % (nick, irc.start_ts)) + if conf.conf['pylink'].get('whois_show_startup_time', True): + f(317, source, "%s 0 %s :seconds idle (placeholder), signon time" % (nick, irc.start_ts)) # Call custom WHOIS handlers via the PYLINK_CUSTOM_WHOIS hook, unless the # caller is marked a bot and the whois_show_extensions_to_bots option is False diff --git a/example-conf.yml b/example-conf.yml index 603843d..e229a74 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -44,6 +44,10 @@ pylink: # accounts for authentication), it is recommended to leave this off. whois_show_extensions_to_bots: false + # Determines whether PyLink should return the daemon startup time in WHOIS. This defaults + # to true if not set. + #whois_show_startup_time: true + # Determines whether PyLink service clients should protect themselves from # kicks, kills, etc. using IRCd-side servprotect modes. For this to work # properly, this usually requires that PyLink be U-Lined. This defaults to diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 469c8f4..b87474f 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -613,8 +613,12 @@ class InspIRCdProtocol(TS6BaseProtocol): # <- :70MAAAAAA IDLE 1MLAAAAIG # -> :1MLAAAAIG IDLE 70MAAAAAA 1433036797 319 + # Allow hiding the startup time if set to do so (if both idle and signon time is 0, InspIRCd omits + # showing this line). + start_time = self.start_ts if conf.conf['pylink'].get('whois_show_startup_time', True) else 0 + # First arg = source, second = signon time, third = idle time - self._send_with_prefix(args[0], 'IDLE %s %s 0' % (source, self.start_ts)) + self._send_with_prefix(args[0], 'IDLE %s %s 0' % (source, start_time)) def handle_ftopic(self, numeric, command, args): """Handles incoming FTOPIC (sets topic on burst)."""