Removing encrypted related id when receiving decrypted event
This commit is contained in:
parent
a42dcbecd7
commit
84351f7b4a
@ -45,6 +45,7 @@ import org.matrix.android.sdk.internal.session.room.relation.poll.FetchPollRespo
|
||||
import org.matrix.android.sdk.internal.task.TaskExecutor
|
||||
import javax.inject.Inject
|
||||
|
||||
// TODO update unit tests
|
||||
internal class DefaultPollAggregationProcessor @Inject constructor(
|
||||
private val taskExecutor: TaskExecutor,
|
||||
private val fetchPollResponseEventsTask: FetchPollResponseEventsTask,
|
||||
@ -155,7 +156,7 @@ internal class DefaultPollAggregationProcessor @Inject constructor(
|
||||
)
|
||||
aggregatedPollSummaryEntity.aggregatedContent = ContentMapper.map(newSumModel.toContent())
|
||||
|
||||
// TODO check also if eventId is part of UTD list of eventIds, if so remove it
|
||||
event.eventId?.let { removeEncryptedRelatedEventIdIfNeeded(aggregatedPollSummaryEntity, it) }
|
||||
|
||||
return true
|
||||
}
|
||||
@ -182,12 +183,12 @@ internal class DefaultPollAggregationProcessor @Inject constructor(
|
||||
aggregatedPollSummaryEntity.sourceEvents.add(event.eventId)
|
||||
}
|
||||
|
||||
event.eventId?.let { removeEncryptedRelatedEventIdIfNeeded(aggregatedPollSummaryEntity, it) }
|
||||
|
||||
if (!isLocalEcho) {
|
||||
ensurePollIsFullyAggregated(roomId, pollEventId)
|
||||
}
|
||||
|
||||
// TODO check also if eventId is part of UTD list of eventIds, if so remove it
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@ -230,4 +231,10 @@ internal class DefaultPollAggregationProcessor @Inject constructor(
|
||||
fetchPollResponseEventsTask.execute(params)
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeEncryptedRelatedEventIdIfNeeded(aggregatedPollSummaryEntity: PollResponseAggregatedSummaryEntity, eventId: String) {
|
||||
if(aggregatedPollSummaryEntity.encryptedRelatedEventIds.contains(eventId)) {
|
||||
aggregatedPollSummaryEntity.encryptedRelatedEventIds.remove(eventId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user