3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-28 13:42:37 +01:00

Limit signon time in WHOIS replies to service bot targets

Faking signon time for relay clients, etc. is misleading...
This commit is contained in:
James Lu 2017-07-12 07:49:19 -07:00
parent 556c2efb0a
commit 50e7b0ab13
3 changed files with 7 additions and 5 deletions

View File

@ -99,7 +99,7 @@ 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
if conf.conf['pylink'].get('whois_show_startup_time', True):
if irc.get_service_bot(target) and 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

View File

@ -44,8 +44,8 @@ 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.
# Determines whether PyLink should return its time of initial connection when replying to WHOIS
# for service bots. This defaults to true if not set.
#whois_show_startup_time: true
# Determines whether PyLink service clients should protect themselves from

View File

@ -615,10 +615,12 @@ class InspIRCdProtocol(TS6BaseProtocol):
# 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
target = args[0]
start_time = self.start_ts if (conf.conf['pylink'].get('whois_show_startup_time', True) and
self.get_service_bot(target)) else 0
# First arg = source, second = signon time, third = idle time
self._send_with_prefix(args[0], 'IDLE %s %s 0' % (source, start_time))
self._send_with_prefix(target, 'IDLE %s %s 0' % (source, start_time))
def handle_ftopic(self, numeric, command, args):
"""Handles incoming FTOPIC (sets topic on burst)."""