mirror of https://github.com/Mikaela/Limnoria.git
Fix for bug #1004002.
This commit is contained in:
parent
d134a2d9ac
commit
3fc03d2fa5
|
@ -301,12 +301,13 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||
'-' in capability:
|
||||
try:
|
||||
id = ircdb.users.getUserId(name)
|
||||
except KeyError:
|
||||
irc.errorNoUser()
|
||||
return
|
||||
user = ircdb.users.getUser(id)
|
||||
user.addCapability(capability)
|
||||
ircdb.users.setUser(id, user)
|
||||
irc.replySuccess()
|
||||
except KeyError:
|
||||
irc.errorNoUser()
|
||||
else:
|
||||
s = 'You can\'t add capabilities you don\'t have.'
|
||||
irc.error(s)
|
||||
|
|
|
@ -564,12 +564,17 @@ class Channel(callbacks.Privmsg):
|
|||
capability = ircdb.makeChannelCapability(channel, capability)
|
||||
try:
|
||||
id = ircdb.users.getUserId(name)
|
||||
user = ircdb.users.getUser(id)
|
||||
user.removeCapability(capability)
|
||||
ircdb.users.setUser(id, user)
|
||||
irc.replySuccess()
|
||||
except KeyError:
|
||||
irc.errorNoUser()
|
||||
return
|
||||
user = ircdb.users.getUser(id)
|
||||
try:
|
||||
user.removeCapability(capability)
|
||||
except KeyError:
|
||||
irc.error('That user doesn\'t have the %s capability.'%capability)
|
||||
return
|
||||
ircdb.users.setUser(id, user)
|
||||
irc.replySuccess()
|
||||
removecapability = privmsgs.checkChannelCapability(removecapability, 'op')
|
||||
|
||||
def setdefaultcapability(self, irc, msg, args, channel):
|
||||
|
|
Loading…
Reference in New Issue