mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
coremods, plugins, protocols: drop now redundant allowAuthed=False in is_oper() calls
This commit is contained in:
parent
2ca9de2ea8
commit
1b68bfadc6
@ -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)
|
||||
|
@ -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.")
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)}}])
|
||||
|
Loading…
Reference in New Issue
Block a user