mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 00:23:49 +00:00
Reify skeleton person objects that local echo creates when sending out-of-realm PMs
(imported from commit c0fcdba736f1270d8c05d00546444ee539301877)
This commit is contained in:
@@ -154,7 +154,7 @@ function insert_local_message(message_request, local_id) {
|
||||
if (person !== undefined) {
|
||||
return person;
|
||||
}
|
||||
return {email: email, full_name: email};
|
||||
return {email: email, full_name: email, skeleton: true};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -91,13 +91,15 @@ exports.reify = function reify(person) {
|
||||
|
||||
// Don't overwrite an already-reified person. If we have
|
||||
// a full name, we already have the full person object loaded
|
||||
if (old_person.full_name !== undefined) {
|
||||
if (old_person.full_name !== undefined && !old_person.skeleton) {
|
||||
return;
|
||||
}
|
||||
|
||||
var old_idx = page_params.people_list.indexOf(old_person);
|
||||
|
||||
var new_person = _.extend({}, old_person, person);
|
||||
new_person.skeleton = false;
|
||||
|
||||
people_dict.set(person.email, person);
|
||||
people_by_name_dict.set(person.full_name, person);
|
||||
page_params.people_list[old_idx] = new_person;
|
||||
|
||||
Reference in New Issue
Block a user