From 39c0cdc15645b6f82d2feff015c249535a66976d Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sun, 1 Oct 2023 22:22:36 +0200 Subject: Mark buffer as read when conversation/thread is marked --- slack/slack_message.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'slack/slack_message.py') 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 ( -- cgit