aboutsummaryrefslogtreecommitdiffstats
path: root/slack/slack_thread.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-10-01 21:31:08 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commit6cf20324f97fa49bade19ecf1f46e2900c2eda08 (patch)
treea4322caa518f577d8d7154cf4a45509b726ecfb3 /slack/slack_thread.py
parent2733d6a0faf3ea9150ee8e16950ca3d54a6361e6 (diff)
downloadwee-slack-6cf20324f97fa49bade19ecf1f46e2900c2eda08.tar.gz
Correctly tag unread messages from history
Now notify tags are set based on last_read so both read and unread messages gets the correct tags irregardless if they come from history or websocket.
Diffstat (limited to 'slack/slack_thread.py')
-rw-r--r--slack/slack_thread.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/slack/slack_thread.py b/slack/slack_thread.py
index 1c94c7d..44a6751 100644
--- a/slack/slack_thread.py
+++ b/slack/slack_thread.py
@@ -30,6 +30,10 @@ class SlackThread(SlackBuffer):
def messages(self) -> Mapping[SlackTs, SlackMessage]:
return self.parent.replies
+ @property
+ def last_read(self) -> SlackTs:
+ return self.parent.last_read
+
async def get_name_and_buffer_props(self) -> Tuple[str, Dict[str, str]]:
conversation_name = await self.parent.conversation.name_with_prefix("full_name")
name = f"{conversation_name}.${self.parent.hash}"
@@ -58,7 +62,7 @@ class SlackThread(SlackBuffer):
with self.loading():
messages = chain([self.parent], self.parent.replies.values())
for message in messages:
- await self.print_message(message, backlog=True)
+ await self.print_message(message)
async def fill_history(self):
if self.history_pending: