From e4cbfcaf1dd72f4780ef0a8d4175e276a5209fdc Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Bodas Date: Wed, 12 May 2021 11:30:54 +0530 Subject: [PATCH] recent senders: Rename sender_info getter function for brevity. We will also later use this function for attaching other information to it like whether the sender has been muted or not. --- frontend_tests/node_tests/people.js | 2 +- frontend_tests/node_tests/recent_topics.js | 2 +- static/js/people.js | 2 +- static/js/recent_topics.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend_tests/node_tests/people.js b/frontend_tests/node_tests/people.js index 3096684ef0..a28bedf393 100644 --- a/frontend_tests/node_tests/people.js +++ b/frontend_tests/node_tests/people.js @@ -681,7 +681,7 @@ test_people("message_methods", () => { "https://secure.gravatar.com/avatar/6dbdd7946b58d8b11351fcb27e5cdd55?d=identicon&s=50", ); - assert.deepEqual(people.sender_info_with_small_avatar_urls_for_sender_ids([30]), [ + assert.deepEqual(people.sender_info_for_recent_topics_row([30]), [ { avatar_url_small: "/avatar/30&s=50", email: "me@example.com", diff --git a/frontend_tests/node_tests/recent_topics.js b/frontend_tests/node_tests/recent_topics.js index f7de768bae..57df8f7f1b 100644 --- a/frontend_tests/node_tests/recent_topics.js +++ b/frontend_tests/node_tests/recent_topics.js @@ -166,7 +166,7 @@ const people = zrequire("people"); const rt = zrequire("recent_topics"); people.is_my_user_id = (id) => id === 1; -people.sender_info_with_small_avatar_urls_for_sender_ids = (ids) => ids; +people.sender_info_for_recent_topics_row = (ids) => ids; let id = 0; diff --git a/static/js/people.js b/static/js/people.js index d355ccec3d..491d111889 100644 --- a/static/js/people.js +++ b/static/js/people.js @@ -657,7 +657,7 @@ export function small_avatar_url_for_person(person) { return format_small_avatar_url("/avatar/" + person.user_id); } -export function sender_info_with_small_avatar_urls_for_sender_ids(sender_ids) { +export function sender_info_for_recent_topics_row(sender_ids) { const senders_info = []; for (const id of sender_ids) { const sender = {...get_by_user_id(id)}; diff --git a/static/js/recent_topics.js b/static/js/recent_topics.js index 00a80c76bc..affe4c43d8 100644 --- a/static/js/recent_topics.js +++ b/static/js/recent_topics.js @@ -315,7 +315,7 @@ function format_topic(topic_data) { // Display in most recent sender first order const all_senders = recent_senders.get_topic_recent_senders(stream_id, topic); const senders = all_senders.slice(-MAX_AVATAR); - const senders_info = people.sender_info_with_small_avatar_urls_for_sender_ids(senders); + const senders_info = people.sender_info_for_recent_topics_row(senders); return { // stream info