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