plugins/Channel: Catch a Key Error in "ban remove" and "ignore remove".

This commit is contained in:
James Vega 2005-06-01 13:24:06 +00:00
parent 766dad2f70
commit c444a67e91

View File

@ -505,9 +505,12 @@ class Channel(callbacks.Plugin):
message isn't sent in the channel itself. message isn't sent in the channel itself.
""" """
c = ircdb.channels.getChannel(channel) c = ircdb.channels.getChannel(channel)
c.removeBan(banmask) try:
ircdb.channels.setChannel(channel, c) c.removeBan(banmask)
irc.replySuccess() ircdb.channels.setChannel(channel, c)
irc.replySuccess()
except KeyError:
irc.error('There are no persistent bans for that hostmask.')
remove = wrap(remove, ['op', 'hostmask']) remove = wrap(remove, ['op', 'hostmask'])
def list(self, irc, msg, args, channel): def list(self, irc, msg, args, channel):
@ -551,9 +554,12 @@ class Channel(callbacks.Plugin):
necessary if the message isn't sent in the channel itself. necessary if the message isn't sent in the channel itself.
""" """
c = ircdb.channels.getChannel(channel) c = ircdb.channels.getChannel(channel)
c.removeIgnore(banmask) try:
ircdb.channels.setChannel(channel, c) c.removeIgnore(banmask)
irc.replySuccess() ircdb.channels.setChannel(channel, c)
irc.replySuccess()
except KeyError:
irc.error('There are no ignores for that hostmask.')
remove = wrap(remove, ['op', 'hostmask']) remove = wrap(remove, ['op', 'hostmask'])
def list(self, irc, msg, args, channel): def list(self, irc, msg, args, channel):