group-pms: Update list when new group pm is made.

The function activity.process_loaded_messages(messages) would be called
from message_events.js, this would call people.huddle_string with the
same message object, it was expected that this would return a list of
ids but the message.display_recipient attribute which was being sent
here used a "user_id" field instead of an "id" field.

Fixes: #12503.
This commit is contained in:
YashRE42
2019-06-23 23:24:30 +05:30
committed by Tim Abbott
parent af4eb8c0d5
commit dd1a6a97bd

View File

@@ -83,11 +83,24 @@ function insert_local_message(message_request, local_id) {
var person = people.get_by_email(email);
if (person === undefined) {
// For unknown users, we return a skeleton object.
return {email: email, full_name: email,
unknown_local_echo_user: true};
return {
email: email,
full_name: email,
unknown_local_echo_user: true,
};
}
// NORMAL PATH
return person;
//
// This should match the format of display_recipient
// objects generated by the backend code in models.py,
// which is why we create a new object with a `.id` field
// rather than a `.user_id` field.
return {
id: person.user_id,
email: person.email,
full_name: person.full_name,
};
});
}