Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
buddy_list: Show `(you)` in the tooltip.
Riken Shah793feb4539dd
diff --git a/frontend_tests/node_tests/buddy_data.js b/frontend_tests/node_tests/buddy_data.jsindex eb0d1d9028d..6cecc4d3813 100644--- a/frontend_tests/node_tests/buddy_data.js+++ b/frontend_tests/node_tests/buddy_data.js@@ -345,13 +345,16 @@ test("title_data", () => {first_line: "Human Myself",second_line: "out to lunch",third_line: "translated: Active now",+ show_you: true,};+ page_params.user_id = me.user_id;assert.deepEqual(buddy_data.get_title_data(me.user_id, is_group), expected_data);expected_data = {first_line: "Old User",second_line: "translated: Last active: translated: More than 2 weeks ago",third_line: "",+ show_you: false,};assert.deepEqual(buddy_data.get_title_data(old_user.user_id, is_group), expected_data);});diff --git a/static/js/buddy_data.js b/static/js/buddy_data.jsindex ec54d764612..66e607f8734 100644--- a/static/js/buddy_data.js+++ b/static/js/buddy_data.js@@ -250,6 +250,7 @@ export function get_title_data(user_ids_string, is_group) {// a single, human, user.const active_status = presence.get_status(user_id);const last_seen = user_last_seen_time_status(user_id);+ const is_my_user = people.is_my_user_id(user_id);// Users has a status.if (user_status.get_status_text(user_id)) {@@ -257,6 +258,7 @@ export function get_title_data(user_ids_string, is_group) {first_line: person.full_name,second_line: user_status.get_status_text(user_id),third_line: get_last_seen(active_status, last_seen),+ show_you: is_my_user,};}@@ -265,6 +267,7 @@ export function get_title_data(user_ids_string, is_group) {first_line: person.full_name,second_line: get_last_seen(active_status, last_seen),third_line: "",+ show_you: is_my_user,};}diff --git a/static/templates/buddy_list_tooltip_content.hbs b/static/templates/buddy_list_tooltip_content.hbsindex 63d53cc1506..ab9c8eebeb2 100644--- a/static/templates/buddy_list_tooltip_content.hbs+++ b/static/templates/buddy_list_tooltip_content.hbs@@ -1,5 +1,9 @@<div class="buddy_list_tooltip_content">- <span class="tooltip_inner_content">{{first_line}}</span>+ <span class="tooltip_inner_content">{{first_line}}+ {{#if show_you}}+ <span class="my_user_status">{{t "(you)" }}</span>+ {{/if}}+ </span>{{#if second_line}}<br><span class="tooltip_inner_content">{{second_line}}</span>{{/if}}