mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	people: Extract function to check if user is a narrow participant.
To be commonly used in ConversationParticipants.
This commit is contained in:
		@@ -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);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user