buddy_list: Show unsubscribed participants in participants list.

If a participant is unsubscribed, we still want to show them in
the participants list, since users might expect them to be there
anyways. We also already calculate the count including the
unsubscribed participants, so this fixes a bug where the count
could be higher than the list of people.
This commit is contained in:
evykassirer
2024-11-27 15:56:27 -08:00
committed by Tim Abbott
parent 35ffaff1f6
commit a6835fc2db

View File

@@ -551,14 +551,14 @@ export class BuddyList extends BuddyListConf {
const pm_ids_set = narrow_state.pm_ids_set(); const pm_ids_set = narrow_state.pm_ids_set();
for (const item of items) { for (const item of items) {
if (buddy_data.user_matches_narrow(item.user_id, pm_ids_set, current_sub?.stream_id)) { if (this.render_data.all_participant_ids.has(item.user_id)) {
if (this.render_data.all_participant_ids.has(item.user_id)) { participants.push(item);
participants.push(item); this.participant_user_ids.push(item.user_id);
this.participant_user_ids.push(item.user_id); } else if (
} else { buddy_data.user_matches_narrow(item.user_id, pm_ids_set, current_sub?.stream_id)
subscribed_users.push(item); ) {
this.users_matching_view_ids.push(item.user_id); subscribed_users.push(item);
} this.users_matching_view_ids.push(item.user_id);
} else { } else {
other_users.push(item); other_users.push(item);
this.other_user_ids.push(item.user_id); this.other_user_ids.push(item.user_id);