Add encrypted event id only if not already in the list

This commit is contained in:
Maxime NATUREL 2022-12-27 09:40:58 +01:00 committed by Maxime NATUREL
parent da6b41c34d
commit fdc28c0383

View file

@ -43,7 +43,9 @@ class EncryptedReferenceAggregationProcessor @Inject constructor() {
) { ) {
event.eventId?.let { eventId -> event.eventId?.let { eventId ->
val existingRelatedPoll = getPollSummaryWithEventId(realm, relatedEventId) val existingRelatedPoll = getPollSummaryWithEventId(realm, relatedEventId)
existingRelatedPoll?.encryptedRelatedEventIds?.add(eventId) if (eventId !in existingRelatedPoll?.encryptedRelatedEventIds.orEmpty()) {
existingRelatedPoll?.encryptedRelatedEventIds?.add(eventId)
}
} }
} }