aboutsummaryrefslogtreecommitdiffstats
path: root/slack/slack_message.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-10-01 22:22:36 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commit39c0cdc15645b6f82d2feff015c249535a66976d (patch)
tree10a121fcd48cd91e8f72b5730f09d2f6491a7602 /slack/slack_message.py
parentb4211c69b4a2b0099a1ad18c569c0df36abac8b2 (diff)
downloadwee-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.py11
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 (