Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

people: Extract function to check if user is a narrow participant.

Aman Agrawal63584f307650
diff --git a/web/src/buddy_data.ts b/web/src/buddy_data.ts
index 92bb42e7bb3..30846122b39 100644
--- a/web/src/buddy_data.ts
+++ b/web/src/buddy_data.ts
@@ -460,10 +460,7 @@ export function get_conversation_participants(): Set<number> {
return participant_ids_set;
}
for (const message of message_lists.current.all_messages()) {
- if (
- !people.is_valid_bot_user(message.sender_id) &&
- people.is_person_active(message.sender_id)
- ) {
+ if (people.is_displayable_conversation_participant(message.sender_id)) {
participant_ids_set.add(message.sender_id);
}
}
diff --git a/web/src/people.ts b/web/src/people.ts
index dc4323fc3ed..4d3be1a882e 100644
--- a/web/src/people.ts
+++ b/web/src/people.ts
@@ -1762,6 +1762,10 @@ export function sort_but_pin_current_user_on_top(users: User[]): void {
}
}
+export function is_displayable_conversation_participant(user_id: number): boolean {
+ return !is_valid_bot_user(user_id) && is_person_active(user_id);
+}
+
export function initialize(my_user_id: number, params: StateData["people"]): void {
for (const person of params.realm_users) {
add_active_user(person);