From 7c5f1533a0659896617688591a8ed8eb6ae19625 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 12 Jul 2017 07:32:26 -0700 Subject: [PATCH] handlers: fix weirdly named variables --- coremods/handlers.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/coremods/handlers.py b/coremods/handlers.py index c3d0fc1..ebf2b0b 100644 --- a/coremods/handlers.py +++ b/coremods/handlers.py @@ -22,8 +22,8 @@ def handle_whois(irc, source, command, args): f(401, source, "%s :No such nick/channel" % nick) else: nick = user.nick - sourceis_oper = ('o', None) in irc.users[source].modes - sourceisBot = (irc.umodes.get('bot'), None) in irc.users[source].modes + source_is_oper = ('o', None) in irc.users[source].modes + source_is_bot = (irc.umodes.get('bot'), None) in irc.users[source].modes # Get the full network name. netname = irc.serverdata.get('netname', irc.name) @@ -35,7 +35,7 @@ def handle_whois(irc, source, command, args): # 319: RPL_WHOISCHANNELS; Show public channels of the target, respecting # hidechans umodes for non-oper callers. isHideChans = (irc.umodes.get('hidechans'), None) in user.modes - if (not isHideChans) or (isHideChans and sourceis_oper): + if (not isHideChans) or (isHideChans and source_is_oper): public_chans = [] for chan in user.channels: c = irc.channels[chan] @@ -44,7 +44,7 @@ def handle_whois(irc, source, command, args): if ((irc.cmodes.get('secret'), None) in c.modes or \ (irc.cmodes.get('private'), None) in c.modes) \ - and not (sourceis_oper or source in c.users): + and not (source_is_oper or source in c.users): continue # Show the highest prefix mode like a regular IRCd does, if there are any. @@ -74,7 +74,7 @@ def handle_whois(irc, source, command, args): # 2) +H is set, but the caller is oper # 3) +H is set, but whois_use_hideoper is disabled in config isHideOper = (irc.umodes.get('hideoper'), None) in user.modes - if (not isHideOper) or (isHideOper and sourceis_oper) or \ + if (not isHideOper) or (isHideOper and source_is_oper) or \ (isHideOper and not conf.conf['bot'].get('whois_use_hideoper', True)): # Let's be gramatically correct. (If the opertype starts with a vowel, # write "an Operator" instead of "a Operator") @@ -84,7 +84,7 @@ def handle_whois(irc, source, command, args): # 379: RPL_WHOISMODES, used by UnrealIRCd and InspIRCd to show user modes. # Only show this to opers! - if sourceis_oper: + if source_is_oper: f(378, source, "%s :is connecting from %s@%s %s" % (nick, user.ident, user.realhost, user.ip)) f(379, source, '%s :is using modes %s' % (nick, irc.join_modes(user.modes, sort=True))) @@ -100,7 +100,7 @@ def handle_whois(irc, source, command, args): # 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 - if (sourceisBot and conf.conf['bot'].get('whois_show_extensions_to_bots')) or (not sourceisBot): + if (source_is_bot and conf.conf['bot'].get('whois_show_extensions_to_bots')) or (not source_is_bot): irc.call_hooks([source, 'PYLINK_CUSTOM_WHOIS', {'target': target, 'server': server}]) else: log.debug('(%s) coremods.handlers.handle_whois: skipping custom whois handlers because '