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,7 +64,8 @@ class Channel(IRCObject.Object):
else: else:
self.modes[mode].add(arg.lower()) self.modes[mode].add(arg.lower())
def remove_mode(self, mode: str, arg: str=None): def remove_mode(self, mode: str, arg: str=None):
if not arg and mode in self.modes: if not arg:
if mode in self.modes:
del self.modes[mode] del self.modes[mode]
else: else:
if mode in self.server.prefix_modes: if mode in self.server.prefix_modes: