Support removal of modes without args that we don't know about in a way that

doesn't push code execution down the wrong path (src/IRCChannel.py)
This commit is contained in:
jesopo 2019-01-16 11:59:36 +00:00
parent aa40936ce6
commit 6405ee2582

View file

@ -64,8 +64,9 @@ class Channel(IRCObject.Object):
else:
self.modes[mode].add(arg.lower())
def remove_mode(self, mode: str, arg: str=None):
if not arg and mode in self.modes:
del self.modes[mode]
if not arg:
if mode in self.modes:
del self.modes[mode]
else:
if mode in self.server.prefix_modes:
user = self.server.get_user(arg)