mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-25 01:00:55 +01:00
Set instead of List, to avoid duplication.
This commit is contained in:
parent
9a0ea7bc2e
commit
a7666e2112
@ -24,7 +24,7 @@ internal class SyncResponsePostTreatmentAggregator {
|
||||
val directChatsToCheck = mutableMapOf<String, String>()
|
||||
|
||||
// List of userIds to fetch and update at the end of incremental syncs
|
||||
val userIdsToFetch = mutableListOf<String>()
|
||||
val userIdsToFetch = mutableSetOf<String>()
|
||||
|
||||
// Set of users to call `crossSigningService.onUsersDeviceUpdate` once per sync
|
||||
val userIdsWithDeviceUpdate = mutableSetOf<String>()
|
||||
|
@ -83,13 +83,13 @@ internal class SyncResponsePostTreatmentAggregatorHandler @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun fetchAndUpdateUsers(userIdsToFetch: List<String>) {
|
||||
private suspend fun fetchAndUpdateUsers(userIdsToFetch: Collection<String>) {
|
||||
fetchUsers(userIdsToFetch)
|
||||
.takeIf { it.isNotEmpty() }
|
||||
?.saveLocally()
|
||||
}
|
||||
|
||||
private suspend fun fetchUsers(userIdsToFetch: List<String>) = userIdsToFetch.mapNotNull {
|
||||
private suspend fun fetchUsers(userIdsToFetch: Collection<String>) = userIdsToFetch.mapNotNull {
|
||||
tryOrNull {
|
||||
val profileJson = getProfileInfoTask.execute(GetProfileInfoTask.Params(it))
|
||||
User.fromJson(it, profileJson)
|
||||
|
Loading…
Reference in New Issue
Block a user