From ae850fdeb4c51020cd78c4047b560bf09781e24b Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 6 Feb 2017 17:54:01 -0800 Subject: [PATCH] Use message.sender_id to create URLs in message popover. --- static/js/popovers.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/static/js/popovers.js b/static/js/popovers.js index dcee8bc165..1060da6418 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -52,10 +52,20 @@ function show_message_info_popover(element, id) { elt.closest(".message_row").find(".message_time")); var message = current_msg_list.get(id); + var sender = people.get_person_from_user_id(message.sender_id); + var sender_email; + + if (sender) { + sender_email = sender.email; + } else { + blueslip.debug('Bad sender in message' + message.sender_id); + sender_email = message.sender_email; + } + var args = { message: message, - pm_with_uri: narrow.pm_with_uri(message.sender_email), - sent_by_uri: narrow.by_sender_uri(message.sender_email), + pm_with_uri: narrow.pm_with_uri(sender_email), + sent_by_uri: narrow.by_sender_uri(sender_email), narrowed: narrow.active(), };