mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +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:
parent
556c2efb0a
commit
50e7b0ab13
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)."""
|
||||
|
Loading…
Reference in New Issue
Block a user