Handle email changes in user_events.update_person().

This code isn't active yet, since the back end doesn't send
events yet for email changes.
This commit is contained in:
Steve Howell 2017-02-04 08:51:05 -08:00 committed by Tim Abbott
parent 4c53ad59f2
commit 10e220f516

View File

@ -16,6 +16,20 @@ exports.update_person = function update(person) {
return;
}
if (_.has(person, 'new_email')) {
var user_id = person.user_id;
var new_email = person.new_email;
narrow.update_email(user_id, new_email);
compose.update_email(user_id, new_email);
if (people.is_my_user_id(person.user_id)) {
settings.update_email(new_email);
}
people.update_email(user_id, new_email);
}
if (_.has(person, 'full_name')) {
people.set_full_name(person_obj, person.full_name);