mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 11:59:12 +03:00
Set instead of List, to avoid duplication.
This commit is contained in:
parent
9a0ea7bc2e
commit
a7666e2112
2 changed files with 3 additions and 3 deletions
|
@ -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 a new issue