diff --git a/readme.md b/readme.md index d6a0829..b0a4dc2 100644 --- a/readme.md +++ b/readme.md @@ -154,6 +154,7 @@ CHAT_FLAGS = { # last msg haven't been seen by recipient "unseen": "✓", "secret": "🔒", + "seen": "✓✓", # leave empty if you don't want to see it } MSG_FLAGS = { "selected": "*", @@ -163,6 +164,7 @@ MSG_FLAGS = { "edited": "E", "pending": "...", "failed": "💩", + "seen": "✓✓", # leave empty if you don't want to see it } # use this app to open url when there are multiple diff --git a/tg/views.py b/tg/views.py index be31a0d..18e449a 100644 --- a/tg/views.py +++ b/tg/views.py @@ -246,6 +246,12 @@ class ChatView: ): # last msg haven't been seen by recipient flags.append("unseen") + elif ( + msg + and self.model.is_me(msg["sender_user_id"]) + and msg["id"] <= chat["last_read_outbox_message_id"] + ): + flags.append("seen") if action_label := _get_action_label(self.model.users, chat): flags.append(action_label) @@ -315,6 +321,11 @@ class MsgView: ): if not self.model.is_me(chat["id"]): flags.append("unseen") + elif ( + self.model.is_me(msg_proxy.sender_id) + and msg_proxy.msg_id <= chat["last_read_outbox_message_id"] + ): + flags.append("seen") if state := msg_proxy.msg.get("sending_state"): log.info("state: %s", state) state_type = state["@type"]