From 0b39ff8b5f7d6bf004deef23938cfc1c76840741 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 12 Jan 2023 12:29:04 -0800 Subject: [PATCH] Reactions: isSentByConversationId is only for reactions from this device --- ts/models/messages.ts | 23 +++++++++++------------ ts/textsecure/WebsocketResources.ts | 1 + 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ts/models/messages.ts b/ts/models/messages.ts index f7028c128d..161870e77a 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -3334,18 +3334,6 @@ export class MessageModel extends window.Backbone.Model { return; } - const newReaction: MessageReactionType = { - emoji: reaction.get('remove') ? undefined : reaction.get('emoji'), - fromId: reaction.get('fromId'), - targetAuthorUuid: reaction.get('targetAuthorUuid'), - targetTimestamp: reaction.get('targetTimestamp'), - timestamp: reaction.get('timestamp'), - isSentByConversationId: zipObject( - conversation.getMemberConversationIds(), - repeat(false) - ), - }; - const isFromThisDevice = reaction.get('source') === ReactionSource.FromThisDevice; const isFromSync = reaction.get('source') === ReactionSource.FromSync; @@ -3356,6 +3344,17 @@ export class MessageModel extends window.Backbone.Model { 'Reaction can only be from this device, from sync, or from someone else' ); + const newReaction: MessageReactionType = { + emoji: reaction.get('remove') ? undefined : reaction.get('emoji'), + fromId: reaction.get('fromId'), + targetAuthorUuid: reaction.get('targetAuthorUuid'), + targetTimestamp: reaction.get('targetTimestamp'), + timestamp: reaction.get('timestamp'), + isSentByConversationId: isFromThisDevice + ? zipObject(conversation.getMemberConversationIds(), repeat(false)) + : undefined, + }; + // Reactions to stories are saved as separate messages, and so require a totally // different codepath. if (storyMessage) { diff --git a/ts/textsecure/WebsocketResources.ts b/ts/textsecure/WebsocketResources.ts index 64c2ba2fd0..aedc90431c 100644 --- a/ts/textsecure/WebsocketResources.ts +++ b/ts/textsecure/WebsocketResources.ts @@ -232,6 +232,7 @@ export default class WebSocketResource extends EventTarget { public close(code = 3000, reason?: string): void { if (this.closed) { + log.info(`WebSocketResource.close: Already closed! ${code}/${reason}`); return; }