Reactions: isSentByConversationId is only for reactions from this device

This commit is contained in:
Scott Nonnenberg 2023-01-12 12:29:04 -08:00 committed by GitHub
parent 28b7acb741
commit 0b39ff8b5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View file

@ -3334,18 +3334,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
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<MessageAttributesType> {
'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) {

View file

@ -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;
}