Add <secret> chat flag (#121)

This commit is contained in:
Nameless 2020-07-09 14:12:26 +08:00 committed by GitHub
parent e078199798
commit aeab7c1564
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -135,6 +135,7 @@ CHAT_FLAGS = {
"unread": "U",
# last msg haven't been seen by recipient
"unseen": "✓",
"secret": "🔒",
}
MSG_FLAGS = {
"selected": "*",

View file

@ -261,6 +261,9 @@ class ChatView:
elif chat["unread_count"]:
flags.append(str(chat["unread_count"]))
if get_chat_type(chat) == ChatType.chatTypeSecret:
flags.append("secret")
label = " ".join(config.CHAT_FLAGS.get(flag, flag) for flag in flags)
if label:
return f" {label}"