diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-10-01 22:22:36 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | 39c0cdc15645b6f82d2feff015c249535a66976d (patch) | |
tree | 10a121fcd48cd91e8f72b5730f09d2f6491a7602 /slack/slack_message.py | |
parent | b4211c69b4a2b0099a1ad18c569c0df36abac8b2 (diff) | |
download | wee-slack-39c0cdc15645b6f82d2feff015c249535a66976d.tar.gz |
Mark buffer as read when conversation/thread is marked
Diffstat (limited to 'slack/slack_message.py')
-rw-r--r-- | slack/slack_message.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/slack/slack_message.py b/slack/slack_message.py index 968c1f7..6294282 100644 --- a/slack/slack_message.py +++ b/slack/slack_message.py @@ -201,6 +201,17 @@ class SlackMessage: else: return SlackTs("0.0") + @last_read.setter + def last_read(self, value: SlackTs): + if "last_read" in self._message_json: + self._message_json["last_read"] = value + if self.thread_buffer: + self.thread_buffer.set_unread_and_hotlist() + else: + raise SlackError( + self.workspace, "Cannot set last_read on a message without last_read" + ) + @property def is_bot_message(self) -> bool: return ( |