diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-10-19 22:32:51 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | 014127990d651d4108c07db265dcc79d42eb2e5b (patch) | |
tree | adefa99cb8b4aa4a753d3be2acb0e2bad9800385 | |
parent | 20fcca5f2ccbd7b524908d11d14a9ce8f33c2dd6 (diff) | |
download | wee-slack-014127990d651d4108c07db265dcc79d42eb2e5b.tar.gz |
Open closed IM/MPIM buffers on new messages
-rw-r--r-- | slack/slack_workspace.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/slack/slack_workspace.py b/slack/slack_workspace.py index f2cb33a..9aa19b1 100644 --- a/slack/slack_workspace.py +++ b/slack/slack_workspace.py @@ -379,11 +379,17 @@ class SlackWorkspace: channel = self.open_conversations.get(channel_id) if channel is None: - log( - LogLevel.DEBUG, - DebugMessageType.LOG, - f"received websocket message for not open conversation, discarding", - ) + if data["type"] == "message": + channel = await self.conversations[channel_id] + if channel.type in ["im", "mpim"]: + await channel.open_buffer() + await channel.set_hotlist() + else: + log( + LogLevel.DEBUG, + DebugMessageType.LOG, + f"received websocket message for not open conversation, discarding", + ) return if data["type"] == "message": |