Skip to content

Commit e0f5236

Browse files
committed
model: Add functonality for rendering BOT_MARKER if messager is bot.
1 parent 271b8c8 commit e0f5236

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

zulipterminal/config/symbols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
STATUS_IDLE = "◒"
2020
STATUS_OFFLINE = "○"
2121
STATUS_INACTIVE = "•"
22-
BOT_MARKER = "🤖"
22+
BOT_MARKER = ""
2323
AUTOHIDE_TAB_LEFT_ARROW = "❰"
2424
AUTOHIDE_TAB_RIGHT_ARROW = "❱"

zulipterminal/config/ui_mappings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
from zulipterminal.api_types import EditPropagateMode
66
from zulipterminal.config.symbols import (
7+
BOT_MARKER,
78
STATUS_ACTIVE,
89
STATUS_IDLE,
910
STATUS_INACTIVE,
1011
STATUS_OFFLINE,
1112
STREAM_MARKER_PRIVATE,
1213
STREAM_MARKER_PUBLIC,
1314
STREAM_MARKER_WEB_PUBLIC,
14-
BOT_MARKER
1515
)
1616

1717

@@ -28,7 +28,7 @@
2828
"idle": STATUS_IDLE,
2929
"offline": STATUS_OFFLINE,
3030
"inactive": STATUS_INACTIVE,
31-
"bot": BOT_MARKER
31+
"bot": BOT_MARKER,
3232
}
3333

3434

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)