aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-09-22 16:50:37 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2023-09-22 16:50:37 +0200
commit49ea42f1e1c5f6acf0a6d579600a0db443b343a4 (patch)
tree429f8c8062510053d423d7d0cfe22c60e65c70a7
parent870a704e7e182d4bba2ed18f20493af1f22e9c5c (diff)
downloadwee-slack-49ea42f1e1c5f6acf0a6d579600a0db443b343a4.tar.gz
Fix being invited to a private channel not working
If someone invited you to a private channel, it wouldn't work because the channel would be unknown to wee-slack and the join function didn't create a new channel instance.
-rw-r--r--wee_slack.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 5567f09..239a839 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -4351,7 +4351,14 @@ def process_thread_marked(message_json, eventrouter, team, channel, metadata):
def process_channel_joined(message_json, eventrouter, team, channel, metadata):
- channel.update_from_message_json(message_json["channel"])
+ if channel is None:
+ channel = create_channel_from_info(
+ eventrouter, message_json["channel"], team, team.myidentifier, team.users
+ )
+ team.channels[message_json["channel"]["id"]] = channel
+ else:
+ channel.update_from_message_json(message_json["channel"])
+
channel.open()