mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
User: Simplify owner-checking logic, and fix crash when @hostmask remove is called by an unregistered user.
This commit is contained in:
parent
8cfb841f3b
commit
bd39debb48
@ -341,12 +341,9 @@ class User(callbacks.Plugin):
|
||||
pass
|
||||
if not user.checkPassword(password) and \
|
||||
not user.checkHostmask(msg.prefix):
|
||||
try:
|
||||
if ircdb.checkCapability(msg.prefix, 'owner'):
|
||||
u = ircdb.users.getUser(msg.prefix)
|
||||
except KeyError:
|
||||
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
||||
Raise=True)
|
||||
if not u._checkCapability('owner'):
|
||||
else:
|
||||
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
||||
Raise=True)
|
||||
try:
|
||||
@ -382,8 +379,7 @@ class User(callbacks.Plugin):
|
||||
hostmask = msg.prefix
|
||||
if not user.checkPassword(password) and \
|
||||
not user.checkHostmask(msg.prefix):
|
||||
u = ircdb.users.getUser(msg.prefix)
|
||||
if not u._checkCapability('owner'):
|
||||
if not ircdb.checkCapability(msg.prefix, 'owner'):
|
||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
||||
return
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user