Normalize the distribution list and UUIDs iOS sends us

This commit is contained in:
Josh Perez 2022-07-29 13:16:36 -04:00 committed by GitHub
parent 4a39264188
commit 7d2b91368d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View file

@ -1946,15 +1946,20 @@ export default class MessageReceiver
return;
}
const normalizedDestinationUuid = normalizeUuid(
destinationUuid,
'handleStoryMessage.destinationUuid'
);
recipient.distributionListIds?.forEach(listId => {
const sentUuids: Set<string> =
distributionListToSentUuid.get(listId) || new Set();
sentUuids.add(destinationUuid);
sentUuids.add(normalizedDestinationUuid);
distributionListToSentUuid.set(listId, sentUuids);
});
isAllowedToReply.set(
destinationUuid,
normalizedDestinationUuid,
recipient.isAllowedToReply !== false
);
});
@ -1975,7 +1980,10 @@ export default class MessageReceiver
isRecipientUpdate: Boolean(sentMessage.isRecipientUpdate),
receivedAtCounter: envelope.receivedAtCounter,
receivedAtDate: envelope.receivedAtDate,
storyDistributionListId: listId,
storyDistributionListId: normalizeUuid(
listId,
'storyDistributionListId'
),
},
this.removeFromCache.bind(this, envelope)
);