Update PM unread counts more dynamically in the client.

When we process messages for unread counts, we now call
people.pm_reply_user_string() to get a string of user ids,
rather than using emails that may have changed since the
message was originally created.
This commit is contained in:
Steve Howell
2017-02-13 16:15:26 -08:00
committed by Tim Abbott
parent ed4adc5650
commit 4c53ad59f2
3 changed files with 31 additions and 10 deletions

View File

@@ -151,7 +151,7 @@ exports.process_loaded_messages = function (messages) {
}
if (message.type === 'private') {
var user_ids_string = people.emails_strings_to_user_ids_string(message.reply_to);
var user_ids_string = people.pm_reply_user_string(message);
if (user_ids_string) {
unread_privates.setdefault(user_ids_string, new Dict());
unread_privates.get(user_ids_string).set(message.id, true);
@@ -175,7 +175,7 @@ exports.process_loaded_messages = function (messages) {
exports.process_read_message = function (message) {
if (message.type === 'private') {
var user_ids_string = people.emails_strings_to_user_ids_string(message.reply_to);
var user_ids_string = people.pm_reply_user_string(message);
if (user_ids_string) {
var dict = unread_privates.get(user_ids_string);
if (dict) {