mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Rename method for clarity
This commit is contained in:
parent
9719c0b2f9
commit
b25f13cceb
1 changed files with 6 additions and 6 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue