Cleanup: Reactions, Delete for Everyone

This commit is contained in:
Scott Nonnenberg 2020-11-02 14:49:07 -08:00 committed by GitHub
parent e8759fc81b
commit 29eaa7b9a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 27 deletions

View file

@ -610,16 +610,7 @@ export class ConversationController {
const messages = await getMessagesBySentAt(targetTimestamp, {
MessageCollection: window.Whisper.MessageCollection,
});
const targetMessage = messages.find(m => {
const contact = m.getContact();
if (!contact) {
return false;
}
const mcid = contact.get('id');
return mcid === targetFromId;
});
const targetMessage = messages.find(m => m.getContactId() === targetFromId);
if (targetMessage) {
return targetMessage.getConversation();

View file

@ -2607,6 +2607,12 @@ type WhatIsThis = typeof window.WhatIsThis;
const message = initIncomingMessage(data, messageDescriptor);
if (data.message.reaction) {
window.normalizeUuids(
data.message.reaction,
['targetAuthorUuid'],
'background::onMessageReceived'
);
const { reaction } = data.message;
window.log.info(
'Queuing incoming reaction for',
@ -2814,6 +2820,12 @@ type WhatIsThis = typeof window.WhatIsThis;
const message = createSentMessage(data, messageDescriptor);
if (data.message.reaction) {
window.normalizeUuids(
data.message.reaction,
['targetAuthorUuid'],
'background::onSentMessage'
);
const { reaction } = data.message;
window.log.info('Queuing sent reaction for', reaction.targetTimestamp);
const reactionModel = window.Whisper.Reactions.add({