Ignore delivery receipts for outgoing reactions
This commit is contained in:
parent
c8099171e2
commit
e46b1f7958
8 changed files with 151 additions and 34 deletions
|
@ -42,6 +42,7 @@ import { getUserLanguages } from '../util/userLanguages';
|
|||
import { copyCdnFields } from '../util/attachments';
|
||||
|
||||
import type { ReactionType } from '../types/Reactions';
|
||||
import { ReactionReadStatus } from '../types/Reactions';
|
||||
import type { ServiceIdString } from '../types/ServiceId';
|
||||
import { normalizeServiceId } from '../types/ServiceId';
|
||||
import { isAciString } from '../util/isAciString';
|
||||
|
@ -2615,13 +2616,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
);
|
||||
}
|
||||
this.set({ reactions });
|
||||
|
||||
await window.Signal.Data.removeReactionFromConversation({
|
||||
emoji: reaction.emoji,
|
||||
fromId: reaction.fromId,
|
||||
targetAuthorServiceId: reaction.targetAuthorAci,
|
||||
targetTimestamp: reaction.targetTimestamp,
|
||||
});
|
||||
} else {
|
||||
log.info(
|
||||
'handleReaction: adding reaction for message',
|
||||
|
@ -2648,8 +2642,19 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
if (isOutgoing(this.attributes) && isFromSomeoneElse) {
|
||||
void conversation.notify(this, reaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await window.Signal.Data.addReaction({
|
||||
if (reaction.remove) {
|
||||
await window.Signal.Data.removeReactionFromConversation({
|
||||
emoji: reaction.emoji,
|
||||
fromId: reaction.fromId,
|
||||
targetAuthorServiceId: reaction.targetAuthorAci,
|
||||
targetTimestamp: reaction.targetTimestamp,
|
||||
});
|
||||
} else {
|
||||
await window.Signal.Data.addReaction(
|
||||
{
|
||||
conversationId: this.get('conversationId'),
|
||||
emoji: reaction.emoji,
|
||||
fromId: reaction.fromId,
|
||||
|
@ -2657,8 +2662,14 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
messageReceivedAt: this.get('received_at'),
|
||||
targetAuthorAci: reaction.targetAuthorAci,
|
||||
targetTimestamp: reaction.targetTimestamp,
|
||||
});
|
||||
}
|
||||
timestamp: reaction.timestamp,
|
||||
},
|
||||
{
|
||||
readStatus: isFromThisDevice
|
||||
? ReactionReadStatus.Read
|
||||
: ReactionReadStatus.Unread,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const currentLength = (this.get('reactions') || []).length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue