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.
This commit is contained in:
Steve Howell 2017-02-10 11:03:23 -08:00 committed by Tim Abbott
parent f56d3807cc
commit 2e07533b4e

View File

@ -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) {