Fixes several bugs

This commit is contained in:
Scott Nonnenberg 2020-08-04 18:13:19 -07:00 committed by GitHub
parent 7eabdffcd0
commit 57308d3104
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 164 additions and 84 deletions

View file

@ -459,6 +459,10 @@
});
}
const placeholderContact = {
title: i18n('unknownContact'),
};
if (groupUpdate.joined) {
changes.push({
type: 'add',
@ -466,7 +470,8 @@
Array.isArray(groupUpdate.joined)
? groupUpdate.joined
: [groupUpdate.joined],
identifier => this.findAndFormatContact(identifier)
identifier =>
this.findAndFormatContact(identifier) || placeholderContact
),
});
}
@ -483,7 +488,8 @@
Array.isArray(groupUpdate.left)
? groupUpdate.left
: [groupUpdate.left],
identifier => this.findAndFormatContact(identifier)
identifier =>
this.findAndFormatContact(identifier) || placeholderContact
),
});
}
@ -2451,7 +2457,12 @@
conversation.get('members')
);
if (difference.length > 0) {
pendingGroupUpdate.push(['joined', difference]);
// Because GroupV1 groups are based on e164 only
const e164s = difference.map(id => {
const c = ConversationController.get(id);
return c ? c.get('e164') : null;
});
pendingGroupUpdate.push(['joined', e164s]);
}
if (conversation.get('left')) {
window.log.warn('re-added to a left group');