Skip to content

Commit c39cbd2

Browse files
committed
model: Add functonality for rendering BOT_MARKER if messager is bot.
1 parent 5fe629c commit c39cbd2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

zulipterminal/model.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,15 @@ def get_all_users(self) -> List[Dict[str, Any]]:
949949
"user_id": user["user_id"],
950950
"status": status,
951951
}
952+
953+
if user["is_bot"]:
954+
self.user_dict[user["email"]] = {
955+
"full_name": user["full_name"],
956+
"email": email,
957+
"user_id": user["user_id"],
958+
"status": "bot",
959+
}
960+
952961
self._all_users_by_id[user["user_id"]] = user
953962
self.user_id_email_dict[user["user_id"]] = email
954963

@@ -984,7 +993,7 @@ def get_all_users(self) -> List[Dict[str, Any]]:
984993
inactive = [
985994
properties
986995
for properties in self.user_dict.values()
987-
if properties["status"] == "inactive"
996+
if properties["status"] == "inactive" or properties["status"] == "bot"
988997
]
989998

990999
# Construct user_list from sorted components of each list

0 commit comments

Comments
 (0)