mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 12:12:54 +01:00
supybot.defaultIgnore shouldn't ignore registered users.
Even if they are not trusted. This fixes a regression in
97016b9c55
.
This happens because 'user._checkCapability' raises a KeyError
when the user has neither this cap or the anticap; which was mistakenly
caught here by the 'except KeyError' expecting to catch non-existing
users.
(And that why 'try' blocks should be limited to as few lines as possible.)
This commit is contained in:
parent
160bcc8b6b
commit
76b5a42428
19
src/ircdb.py
19
src/ircdb.py
@ -1172,18 +1172,25 @@ def checkIgnored(hostmask, recipient='', users=users, channels=channels):
|
||||
try:
|
||||
id = users.getUserId(hostmask)
|
||||
user = users.getUser(id)
|
||||
if user._checkCapability('trusted'):
|
||||
# Trusted users (including owners) shouldn't ever be ignored.
|
||||
return False
|
||||
elif user.ignore:
|
||||
log.debug('Ignoring %s due to their IrcUser ignore flag.', hostmask)
|
||||
return True
|
||||
except KeyError:
|
||||
# If there's no user...
|
||||
if conf.supybot.defaultIgnore():
|
||||
log.debug('Ignoring %s due to conf.supybot.defaultIgnore',
|
||||
hostmask)
|
||||
return True
|
||||
else:
|
||||
try:
|
||||
is_trusted = user._checkCapability('trusted')
|
||||
except KeyError:
|
||||
# neither explicitly trusted or -trusted -> consider them not
|
||||
# trusted
|
||||
is_trusted = False
|
||||
if is_trusted:
|
||||
# Trusted users (including owners) shouldn't ever be ignored.
|
||||
return False
|
||||
elif user.ignore:
|
||||
log.debug('Ignoring %s due to their IrcUser ignore flag.', hostmask)
|
||||
return True
|
||||
if ignores.checkIgnored(hostmask):
|
||||
log.debug('Ignoring %s due to ignore database.', hostmask)
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user