diff options
| author | 2019-11-08 17:05:09 +0000 | |
|---|---|---|
| committer | 2019-11-08 17:05:09 +0000 | |
| commit | b41588b0981f6926fdb619fbf0319dbeab746615 (patch) | |
| tree | 36b7508bd4bdbcb5633aa474b1ac17358c5791ea | |
| parent | JOIN keys should be comma separated too (diff) | |
| signature | ||
Don't assign `keys` to an array index that doesn't exist yet
| -rw-r--r-- | modules/channel_keys.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/channel_keys.py b/modules/channel_keys.py index 5380e6db..01e3c38f 100644 --- a/modules/channel_keys.py +++ b/modules/channel_keys.py @@ -15,7 +15,13 @@ class Module(ModuleManager.BaseModule): def preprocess_send_join(self, event): if event["line"].args: channels = event["line"].args[0].split(",") - keys = event["line"].args[1:] + + init_keys = False + if len(event["line"].args) > 1: + init_keys = True + keys = event["line"].args[1].split(",") + else: + keys = [] with_keys = {} for channel in channels: @@ -33,7 +39,10 @@ class Module(ModuleManager.BaseModule): channels_out.append(channel_name) if key: keys_out.append(key) + event["line"].args[0] = ",".join(channels_out) + if not init_keys: + event["line"].args.append(None) event["line"].args[1] = ",".join(keys_out) @utils.hook("received.324") |
