From eab2dbab1eed1969bca4486c19b2093734509d86 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Fri, 18 Nov 2022 17:25:51 +0000 Subject: [PATCH] Revert "recent: Remove participant avatars from PM rows." This reverts commit 7e1fe7e56967c86b488432ed09a9a8a6d0d471ef. --- static/js/recent_topics_ui.js | 18 +++++++++--------- static/templates/recent_topic_row.hbs | 3 --- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/static/js/recent_topics_ui.js b/static/js/recent_topics_ui.js index 48a869669d..d476e30aad 100644 --- a/static/js/recent_topics_ui.js +++ b/static/js/recent_topics_ui.js @@ -426,15 +426,9 @@ function format_conversation(conversation_data) { context.pm_url = last_msg.pm_with_url; context.is_group = last_msg.display_recipient.length > 2; - // Don't show participant avatars for PMs. - // "Participants" column on "Recent topics" does not provide accurate information for PM conversations. - // In particular, it duplicates the PM recipients list under "Topics" - // (with the addition of the current user), but does not depend on who sent messages to the thread. - // TODO: https://github.com/zulip/zulip/issues/23563 - all_senders = []; - senders = []; - extra_sender_ids = []; - displayed_other_senders = []; + // Display in most recent sender first order + all_senders = last_msg.display_recipient; + senders = all_senders.slice(-MAX_AVATAR).map((sender) => sender.id); if (!context.is_group) { const user_id = Number.parseInt(last_msg.to_user_ids, 10); @@ -447,6 +441,12 @@ function format_conversation(conversation_data) { context.user_circle_class = buddy_data.get_user_circle_class(user_id); } } + + // Collect extra senders fullname for tooltip. + extra_sender_ids = all_senders.slice(0, -MAX_AVATAR); + displayed_other_senders = extra_sender_ids + .slice(-MAX_EXTRA_SENDERS) + .map((sender) => sender.id); } context.senders = people.sender_info_for_recent_topics_row(senders); diff --git a/static/templates/recent_topic_row.hbs b/static/templates/recent_topic_row.hbs index bd56970a5e..902e0bcb55 100644 --- a/static/templates/recent_topic_row.hbs +++ b/static/templates/recent_topic_row.hbs @@ -70,8 +70,6 @@