aboutsummaryrefslogtreecommitdiffstats
path: root/slack/slack_workspace.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_workspace.py
parentb4211c69b4a2b0099a1ad18c569c0df36abac8b2 (diff)
downloadwee-slack-39c0cdc15645b6f82d2feff015c249535a66976d.tar.gz
Mark buffer as read when conversation/thread is marked
Diffstat (limited to 'slack/slack_workspace.py')
-rw-r--r--slack/slack_workspace.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/slack/slack_workspace.py b/slack/slack_workspace.py
index dcf0279..59ac415 100644
--- a/slack/slack_workspace.py
+++ b/slack/slack_workspace.py
@@ -320,6 +320,11 @@ class SlackWorkspace:
return
elif data["type"] == "reaction_added" or data["type"] == "reaction_removed":
channel_id = data["item"]["channel"]
+ elif (
+ data["type"] == "thread_marked"
+ and data["subscription"]["type"] == "thread"
+ ):
+ channel_id = data["subscription"]["channel"]
elif data["type"] == "sh_room_join" or data["type"] == "sh_room_update":
channel_id = data["huddle"]["channel_id"]
elif "channel" in data and type(data["channel"]) == str:
@@ -356,6 +361,22 @@ class SlackWorkspace:
await channel.reaction_remove(
SlackTs(data["item"]["ts"]), data["reaction"], data["user"]
)
+ elif (
+ data["type"] == "channel_marked"
+ or data["type"] == "group_marked"
+ or data["type"] == "mpim_marked"
+ or data["type"] == "im_marked"
+ ):
+ channel.last_read = SlackTs(data["ts"])
+ elif (
+ data["type"] == "thread_marked"
+ and data["subscription"]["type"] == "thread"
+ ):
+ message = channel.messages.get(
+ SlackTs(data["subscription"]["thread_ts"])
+ )
+ if message:
+ message.last_read = SlackTs(data["subscription"]["last_read"])
elif data["type"] == "sh_room_join" or data["type"] == "sh_room_update":
await channel.update_message_room(data)
elif data["type"] == "user_typing":