Don't send empty JOIN when we have no saved channels (channel_save.py)

This commit is contained in:
jesopo 2019-02-10 14:55:46 +00:00
parent cf64e8832b
commit af3057dee0

View file

@ -3,7 +3,10 @@ from src import ModuleManager, utils
class Module(ModuleManager.BaseModule):
@utils.hook("received.numeric.001")
def on_connect(self, event):
channels = event["server"].get_setting("autojoin", [])
channels = event["server"].get_setting("autojoin", [])
if not channels:
return
chan_keys = event["server"].get_setting("channel_keys", {})
channels_sorted = sorted(channels,
key=lambda x: 0 if x in chan_keys else 1)