popovers: Clean up name fetching for presence user info.

Previously, we relied on fetching the name of the user from the data
attributes on the individual elements, when we can get a more reliably
up-to-date value from the people.js data structure we're fetching
anyway.
This commit is contained in:
Tim Abbott
2017-09-30 08:11:31 -07:00
parent 16c4ec3a2e
commit d56aa83e31

View File

@@ -423,7 +423,6 @@ exports.register_click_handlers = function () {
// as the presence list may be redrawn with new elements. // as the presence list may be redrawn with new elements.
var target = $(this).closest('li'); var target = $(this).closest('li');
var user_id = target.find('a').attr('data-user-id'); var user_id = target.find('a').attr('data-user-id');
var name = target.find('a').attr('data-name');
if (current_user_sidebar_user_id === user_id) { if (current_user_sidebar_user_id === user_id) {
// If the popover is already shown, clicking again should toggle it. // If the popover is already shown, clicking again should toggle it.
@@ -442,7 +441,7 @@ exports.register_click_handlers = function () {
var args = { var args = {
user_email: user_email, user_email: user_email,
user_full_name: name, user_full_name: user.full_name,
user_id: user_id, user_id: user_id,
user_time: people.get_user_time(user_id), user_time: people.get_user_time(user_id),
presence_status: presence.get_status(user_id), presence_status: presence.get_status(user_id),