Send/Receive support for reaction read syncs

This commit is contained in:
Josh Perez 2021-05-06 18:15:25 -07:00 committed by GitHub
parent 82a9705010
commit e0c324e4ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 1188 additions and 498 deletions

View file

@ -60,8 +60,14 @@
// Remove the last notification if both conditions hold:
//
// 1. Either `conversationId` or `messageId` matches (if present)
// 2. `reactionFromId` matches (if present)
removeBy({ conversationId, messageId, reactionFromId }) {
// 2. `emoji`, `targetAuthorUuid`, `targetTimestamp` matches (if present)
removeBy({
conversationId,
messageId,
emoji,
targetAuthorUuid,
targetTimestamp,
}) {
if (!this.notificationData) {
return;
}
@ -81,10 +87,15 @@
return;
}
const { reaction } = this.notificationData;
if (
reactionFromId &&
this.notificationData.reaction &&
this.notificationData.reaction.fromId !== reactionFromId
reaction &&
emoji &&
targetAuthorUuid &&
targetTimestamp &&
(reaction.emoji !== emoji ||
reaction.targetAuthorUuid !== targetAuthorUuid ||
reaction.targetTimestamp !== targetTimestamp)
) {
return;
}