From 2e07533b4e4f09387e869dc7f7df6d5cfc211f37 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Fri, 10 Feb 2017 11:03:23 -0800 Subject: [PATCH] Add compose.update_email(). When we get notified of an email change and the compose box is open for PMs, we should update the email in the compose box. This helper will be useful when we start handling such events. --- static/js/compose.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/static/js/compose.js b/static/js/compose.js index 05e5e11665..bd9123c8cb 100644 --- a/static/js/compose.js +++ b/static/js/compose.js @@ -734,6 +734,17 @@ exports.has_message_content = function () { return exports.message_content() !== ""; }; +exports.update_email = function (user_id, new_email) { + var reply_to = exports.recipient(); + + if (!reply_to) { + return; + } + + reply_to = people.update_email_in_reply_to(reply_to, user_id, new_email); + + exports.recipient(reply_to); +}; // *Synchronously* check if a stream exists. exports.check_stream_existence = function (stream_name, autosubscribe) {