diff --git a/ts/models/messages.ts b/ts/models/messages.ts index f7028c128..161870e77 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 64c2ba2fd..aedc90431 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; }