Some networks allow you to remove user modes that don't exist e.g. removing +o

from someone that doesn't have it. wtf.
This commit is contained in:
jesopo 2018-10-18 21:07:08 +01:00
parent 751aaa3365
commit 6bcfcb60ea

View file

@ -66,7 +66,9 @@ class Channel(IRCObject.Object):
if mode in self.server.prefix_modes: if mode in self.server.prefix_modes:
user = self.server.get_user(arg) user = self.server.get_user(arg)
if user: if user:
if mode in self.modes:
self.modes[mode].discard(user) self.modes[mode].discard(user)
if user in self.user_modes:
self.user_modes[user].discard(mode) self.user_modes[user].discard(mode)
if not self.user_modes[user]: if not self.user_modes[user]:
del self.user_modes[user] del self.user_modes[user]