From b25f13cceba53b3aae65e7ba7dbfecd2bd0cf986 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 4 Mar 2021 21:46:30 +0100 Subject: [PATCH] Rename method for clarity --- .../sdk/internal/session/sync/RoomSyncHandler.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncHandler.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncHandler.kt index 20ea412f14..7de64fd56e 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncHandler.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncHandler.kt @@ -119,7 +119,7 @@ internal class RoomSyncHandler @Inject constructor(private val readReceiptHandle val rooms = when (handlingStrategy) { is HandlingStrategy.JOINED -> { if (isInitialSync && initialSyncStrategy is InitialSyncStrategy.Optimized) { - insertJoinRooms(realm, handlingStrategy, insertType, syncLocalTimeStampMillis, reporter) + insertJoinRoomsFromInitSync(realm, handlingStrategy, insertType, syncLocalTimeStampMillis, reporter) // Rooms are already inserted, return an empty list emptyList() } else { @@ -142,11 +142,11 @@ internal class RoomSyncHandler @Inject constructor(private val readReceiptHandle realm.insertOrUpdate(rooms) } - private fun insertJoinRooms(realm: Realm, - handlingStrategy: HandlingStrategy.JOINED, - insertType: EventInsertType, - syncLocalTimeStampMillis: Long, - reporter: ProgressReporter?) { + private fun insertJoinRoomsFromInitSync(realm: Realm, + handlingStrategy: HandlingStrategy.JOINED, + insertType: EventInsertType, + syncLocalTimeStampMillis: Long, + reporter: ProgressReporter?) { val maxSize = (initialSyncStrategy as? InitialSyncStrategy.Optimized)?.maxRoomsToInsert ?: Int.MAX_VALUE val listSize = handlingStrategy.data.keys.size val numberOfChunks = ceil(listSize / maxSize.toDouble()).toInt()