Reverts timestamp condition but changes timing of setting closedTime

This commit is contained in:
ericdecanini 2022-03-10 16:32:42 +01:00
parent 080844dc9d
commit 628a160c3a
1 changed files with 3 additions and 3 deletions

View File

@ -385,7 +385,7 @@ internal class EventRelationsAggregationProcessor @Inject constructor(
} }
val closedTime = existingPollSummary?.closedTime val closedTime = existingPollSummary?.closedTime
if (closedTime != null) { if (closedTime != null && eventTimestamp > closedTime) {
Timber.v("## POLL is closed ignore event poll:$targetEventId, event :${event.eventId}") Timber.v("## POLL is closed ignore event poll:$targetEventId, event :${event.eventId}")
return return
} }
@ -499,6 +499,8 @@ internal class EventRelationsAggregationProcessor @Inject constructor(
} }
val txId = event.unsignedData?.transactionId val txId = event.unsignedData?.transactionId
existingPollSummary.closedTime = event.originServerTs
// is it a remote echo? // is it a remote echo?
if (!isLocalEcho && existingPollSummary.sourceLocalEchoEvents.contains(txId)) { if (!isLocalEcho && existingPollSummary.sourceLocalEchoEvents.contains(txId)) {
// ok it has already been managed // ok it has already been managed
@ -507,8 +509,6 @@ internal class EventRelationsAggregationProcessor @Inject constructor(
existingPollSummary.sourceEvents.add(event.eventId) existingPollSummary.sourceEvents.add(event.eventId)
return return
} }
existingPollSummary.closedTime = event.originServerTs
} }
private fun getPollEvent(roomId: String, eventId: String): TimelineEvent? { private fun getPollEvent(roomId: String, eventId: String): TimelineEvent? {