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:
parent
751aaa3365
commit
6bcfcb60ea
1 changed files with 6 additions and 4 deletions
|
@ -66,10 +66,12 @@ 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:
|
||||||
self.modes[mode].discard(user)
|
if mode in self.modes:
|
||||||
self.user_modes[user].discard(mode)
|
self.modes[mode].discard(user)
|
||||||
if not self.user_modes[user]:
|
if user in self.user_modes:
|
||||||
del self.user_modes[user]
|
self.user_modes[user].discard(mode)
|
||||||
|
if not self.user_modes[user]:
|
||||||
|
del self.user_modes[user]
|
||||||
else:
|
else:
|
||||||
self.modes[mode].discard(arg.lower())
|
self.modes[mode].discard(arg.lower())
|
||||||
if not len(self.modes[mode]):
|
if not len(self.modes[mode]):
|
||||||
|
|
Loading…
Reference in a new issue