don't return "+" when a channel has no modes

This commit is contained in:
jesopo 2019-09-10 15:10:14 +01:00
parent ef7da3409b
commit 8d8d9219b8

View file

@ -73,7 +73,10 @@ class Channel(IRCObject.Object):
out_modes = "".join(mode for mode, args in modes) out_modes = "".join(mode for mode, args in modes)
out_args = " ".join(args[0] for mode, args in modes if args) out_args = " ".join(args[0] for mode, args in modes if args)
return "+%s%s" % (out_modes, " %s" % out_args if out_args else "") if out_modes:
return "+%s%s" % (out_modes, " %s" % out_args if out_args else "")
else:
return ""
def add_mode(self, mode: str, arg: str=None): def add_mode(self, mode: str, arg: str=None):
if not mode in self.modes: if not mode in self.modes: