people: Extract get_display_full_name from get_display_full_names.

We previously added support for showing the status_emoji to the PM
list, but we only supported individual PMs and not group PMs, this is
prep commit towards supporting group PMs.
This commit is contained in:
YashRE42 2022-03-19 21:14:50 +05:30 committed by Tim Abbott
parent 417766a3e3
commit 72cf5bd90d
1 changed files with 15 additions and 13 deletions

View File

@ -306,20 +306,22 @@ export function get_full_names_for_poll_option(user_ids) {
return get_display_full_names(user_ids).join(", ");
}
function get_display_full_name(user_id) {
const person = get_by_user_id(user_id);
if (!person) {
blueslip.error("Unknown user id " + user_id);
return "?";
}
if (muted_users.is_user_muted(user_id)) {
return $t({defaultMessage: "Muted user"});
}
return person.full_name;
}
export function get_display_full_names(user_ids) {
return user_ids.map((user_id) => {
const person = get_by_user_id(user_id);
if (!person) {
blueslip.error("Unknown user id " + user_id);
return "?";
}
if (muted_users.is_user_muted(user_id)) {
return $t({defaultMessage: "Muted user"});
}
return person.full_name;
});
return user_ids.map((user_id) => get_display_full_name(user_id));
}
export function get_full_name(user_id) {