3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 12:12:53 +01:00

inspircd: new use_experimental_whois option, which forces PyLink to handle WHOIS requests locally

This commit is contained in:
James Lu 2016-06-27 22:28:37 -07:00
parent 57afa806e3
commit f458a40e1c
2 changed files with 19 additions and 3 deletions

View File

@ -120,6 +120,13 @@ servers:
# This setting defaults to sha256. # This setting defaults to sha256.
#ssl_fingerprint_type: 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: ts6net:
ip: ::1 ip: ::1
@ -374,13 +381,15 @@ relay:
show_ips: false show_ips: false
# Determines whether NickServ login info should be shown in the /whois output for # Determines whether NickServ login info should be shown in the /whois output for
# relay users. This works on most IRCds EXCEPT InspIRCd. # relay users. For InspIRCd networks, this requires "use_experimental_whois" to be
# set.
# Valid options include "all" (show this to everyone), "opers" (show only to # Valid options include "all" (show this to everyone), "opers" (show only to
# opers), and "none" (disabled). Defaults to none if not specified. # opers), and "none" (disabled). Defaults to none if not specified.
whois_show_accounts: all whois_show_accounts: all
# Determines whether the origin server should be shown in the /whois output for # Determines whether the origin server should be shown in the /whois output for
# relay users. This works on most IRCds EXCEPT InspIRCd. # relay users. For InspIRCd networks, this requires "use_experimental_whois" to be
# set.
# Valid options include "all" (show this to everyone), "opers" (show only to # Valid options include "all" (show this to everyone), "opers" (show only to
# opers), and "none" (disabled). Defaults to none if not specified. # opers), and "none" (disabled). Defaults to none if not specified.
whois_show_server: opers whois_show_server: opers

View File

@ -607,7 +607,14 @@ class InspIRCdProtocol(TS6BaseProtocol):
# -> :1MLAAAAIG IDLE 70MAAAAAA 1433036797 319 # -> :1MLAAAAIG IDLE 70MAAAAAA 1433036797 319
sourceuser = numeric sourceuser = numeric
targetuser = args[0] targetuser = args[0]
self._send(targetuser, 'IDLE %s %s 0' % (sourceuser, self.irc.users[targetuser].ts))
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))
def handle_ftopic(self, numeric, command, args): def handle_ftopic(self, numeric, command, args):
"""Handles incoming FTOPIC (sets topic on burst).""" """Handles incoming FTOPIC (sets topic on burst)."""