3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +01:00

handlers: use conf.conf['pylink']

This commit is contained in:
James Lu 2017-07-12 07:35:51 -07:00
parent 6a0859f56a
commit adaa6021f9

View File

@ -75,7 +75,7 @@ def handle_whois(irc, source, command, args):
# 3) +H is set, but whois_use_hideoper is disabled in config # 3) +H is set, but whois_use_hideoper is disabled in config
isHideOper = (irc.umodes.get('hideoper'), None) in user.modes isHideOper = (irc.umodes.get('hideoper'), None) in user.modes
if (not isHideOper) or (isHideOper and source_is_oper) or \ if (not isHideOper) or (isHideOper and source_is_oper) or \
(isHideOper and not conf.conf['bot'].get('whois_use_hideoper', True)): (isHideOper and not conf.conf['pylink'].get('whois_use_hideoper', True)):
# Let's be gramatically correct. (If the opertype starts with a vowel, # Let's be gramatically correct. (If the opertype starts with a vowel,
# write "an Operator" instead of "a Operator") # write "an Operator" instead of "a Operator")
n = 'n' if user.opertype[0].lower() in 'aeiou' else '' n = 'n' if user.opertype[0].lower() in 'aeiou' else ''
@ -103,7 +103,7 @@ def handle_whois(irc, source, command, args):
# Call custom WHOIS handlers via the PYLINK_CUSTOM_WHOIS hook, unless the # 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 # caller is marked a bot and the whois_show_extensions_to_bots option is False
if (source_is_bot and conf.conf['bot'].get('whois_show_extensions_to_bots')) or (not source_is_bot): if (source_is_bot and conf.conf['pylink'].get('whois_show_extensions_to_bots')) or (not source_is_bot):
irc.call_hooks([source, 'PYLINK_CUSTOM_WHOIS', {'target': target, 'server': server}]) irc.call_hooks([source, 'PYLINK_CUSTOM_WHOIS', {'target': target, 'server': server}])
else: else:
log.debug('(%s) coremods.handlers.handle_whois: skipping custom whois handlers because ' log.debug('(%s) coremods.handlers.handle_whois: skipping custom whois handlers because '