Fix an issue in MODE handling

This commit is contained in:
jesopo 2017-01-27 21:39:07 +00:00
parent ac7b5c14f4
commit facd9d69cb
No known key found for this signature in database
GPG key ID: 0BBDEB2AEFCFFCB3

View file

@ -212,13 +212,13 @@ def handle_MODE():
channel.remove_mode(char) channel.remove_mode(char)
else: else:
channel.add_mode(char) channel.add_mode(char)
elif char in server.mode_prefixes.values(): elif char in server.mode_prefixes.values() and len(args):
nickname = args.pop(0) nickname = args.pop(0)
if remove: if remove:
channel.remove_mode(char, nickname) channel.remove_mode(char, nickname)
else: else:
channel.add_mode(char, nickname) channel.add_mode(char, nickname)
else: elif len(args):
args.pop(0) args.pop(0)
bot.events.on("received").on("mode").call( bot.events.on("received").on("mode").call(
line=line, line_split=line_split, server=server, modes=modes, line=line, line_split=line_split, server=server, modes=modes,