diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineChunk.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineChunk.kt index 1bd541c2a9..db90343422 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineChunk.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineChunk.kt @@ -436,8 +436,8 @@ internal class TimelineChunk(private val chunkEntity: ChunkEntity, // Check consistency to item before insertions if (range.startIndex > 0) { val firstInsertion = results[range.startIndex]!! - val lastBeforeInsertion = builtEvents[range.startIndex-1] - if (firstInsertion.displayIndex+1 != lastBeforeInsertion.displayIndex) { + val lastBeforeInsertion = builtEvents[range.startIndex - 1] + if (firstInsertion.displayIndex + 1 != lastBeforeInsertion.displayIndex) { Timber.i("handleDatabaseChangeSet: skip insertion at ${range.startIndex}/${builtEvents.size}, " + "displayIndex mismatch at ${range.startIndex}: ${firstInsertion.displayIndex} -> ${lastBeforeInsertion.displayIndex}") continue @@ -445,11 +445,11 @@ internal class TimelineChunk(private val chunkEntity: ChunkEntity, } // Check consistency to item after insertions if (range.startIndex < builtEvents.size) { - val lastInsertion = results[range.startIndex+range.length-1]!! + val lastInsertion = results[range.startIndex + range.length - 1]!! val firstAfterInsertion = builtEvents[range.startIndex] - if (firstAfterInsertion.displayIndex+1 != lastInsertion.displayIndex) { + if (firstAfterInsertion.displayIndex + 1 != lastInsertion.displayIndex) { Timber.i("handleDatabaseChangeSet: skip insertion at ${range.startIndex}/${builtEvents.size}, " + - "displayIndex mismatch at ${range.startIndex+range.length}: " + + "displayIndex mismatch at ${range.startIndex + range.length}: " + "${firstAfterInsertion.displayIndex} -> ${lastInsertion.displayIndex}") continue }