Fix incoming group messages appearing from the group

This commit is contained in:
Ken Powers 2020-04-13 14:49:10 -04:00 committed by GitHub
parent fb11ac50d2
commit 324472e431
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -242,7 +242,7 @@
// Older messages don't have the recipients included on the message, so we fall // Older messages don't have the recipients included on the message, so we fall
// back to the conversation's current recipients // back to the conversation's current recipients
const conversationIds = this.isIncoming() const conversationIds = this.isIncoming()
? [this.getConversation().get('id')] ? [this.getContact().get('id')]
: _.union( : _.union(
(this.get('sent_to') || []).map(id => (this.get('sent_to') || []).map(id =>
ConversationController.getConversationId(id) ConversationController.getConversationId(id)
@ -410,11 +410,11 @@
getPropsForSafetyNumberNotification() { getPropsForSafetyNumberNotification() {
const conversation = this.getConversation(); const conversation = this.getConversation();
const isGroup = conversation && !conversation.isPrivate(); const isGroup = conversation && !conversation.isPrivate();
const phoneNumber = this.get('key_changed'); const identifier = this.get('key_changed');
return { return {
isGroup, isGroup,
contact: this.findAndFormatContact(phoneNumber), contact: this.findAndFormatContact(identifier),
}; };
}, },
getPropsForVerificationNotification() { getPropsForVerificationNotification() {
@ -894,8 +894,8 @@
); );
} }
if (this.isKeyChange()) { if (this.isKeyChange()) {
const phoneNumber = this.get('key_changed'); const identifier = this.get('key_changed');
const conversation = this.findContact(phoneNumber); const conversation = this.findContact(identifier);
return i18n( return i18n(
'safetyNumberChangedGroup', 'safetyNumberChangedGroup',
conversation ? conversation.getTitle() : null conversation ? conversation.getTitle() : null