3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-23 19:19:31 +01:00

coremods, plugins, protocols: drop now redundant allowAuthed=False in is_oper() calls

This commit is contained in:
James Lu 2018-06-11 23:56:44 -07:00
parent 2ca9de2ea8
commit 1b68bfadc6
5 changed files with 6 additions and 6 deletions

View File

@ -74,7 +74,7 @@ def ircop(irc, host, uid):
if len(groups) == 1:
# 1st scenario.
return irc.is_oper(uid, allowAuthed=False)
return irc.is_oper(uid)
else:
# 2nd scenario. Use match_host (ircmatch) to match the opertype glob to the opertype.
return irc.match_host(groups[1], irc.users[uid].opertype)

View File

@ -78,7 +78,7 @@ def _irc_try_login(irc, source, username, skip_checks=False):
irc.name, username, irc.get_hostmask(source), ', '.join(network_filter), irc.name)
raise utils.NotAuthorizedError("Account is not authorized to login on this network.")
elif require_oper and not irc.is_oper(source, allowAuthed=False):
elif require_oper and not irc.is_oper(source):
log.warning("(%s) Failed login to %r from %s (needs oper)", irc.name, username, irc.get_hostmask(source))
raise utils.NotAuthorizedError("You must be opered.")

View File

@ -19,7 +19,7 @@ def _punish(irc, target, channel, punishment, reason):
if target not in irc.users:
log.warning("(%s) antispam: got target %r that isn't a user?", irc.name, target)
return False
elif irc.is_oper(target, allowAuthed=False):
elif irc.is_oper(target):
log.debug("(%s) antispam: refusing to punish oper %s/%s", irc.name, target, irc.get_friendly_name(target))
return False

View File

@ -1202,7 +1202,7 @@ def handle_relay_whois(irc, source, command, args):
setting = conf.conf.get('relay', {}).get(infoline, '').lower()
if setting == 'all':
return True
elif setting == 'opers' and irc.is_oper(source, allowAuthed=False):
elif setting == 'opers' and irc.is_oper(source):
return True
return False

View File

@ -800,12 +800,12 @@ class ClientbotWrapperProtocol(IRCCommonProtocol):
if self.serverdata.get('track_oper_statuses'):
if '*' in status: # Track IRCop status
if not self.is_oper(uid, allowAuthed=False):
if not self.is_oper(uid):
# Don't send duplicate oper ups if the target is already oper.
self.apply_modes(uid, [('+o', None)])
self.call_hooks([uid, 'MODE', {'target': uid, 'modes': {('+o', None)}}])
self.call_hooks([uid, 'CLIENT_OPERED', {'text': 'IRC Operator'}])
elif self.is_oper(uid, allowAuthed=False) and not self.is_internal_client(uid):
elif self.is_oper(uid) and not self.is_internal_client(uid):
# Track deopers
self.apply_modes(uid, [('-o', None)])
self.call_hooks([uid, 'MODE', {'target': uid, 'modes': {('-o', None)}}])