mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
avoid duplicate userId on key download
This commit is contained in:
parent
87de51b184
commit
49d33f3a4b
1 changed files with 3 additions and 2 deletions
|
@ -172,13 +172,14 @@ internal class EventDecryptor @Inject constructor(
|
|||
toUnwedge
|
||||
.chunked(100) // safer to chunk if we ever have lots of wedged devices
|
||||
.forEach { wedgedList ->
|
||||
val groupedByUserId = wedgedList.groupBy { it.userId }
|
||||
// lets download keys if needed
|
||||
withContext(coroutineDispatchers.io) {
|
||||
deviceListManager.downloadKeys(wedgedList.map { it.userId }, false)
|
||||
deviceListManager.downloadKeys(groupedByUserId.keys.toList(), false)
|
||||
}
|
||||
|
||||
// find the matching devices
|
||||
wedgedList.groupBy { it.userId }
|
||||
groupedByUserId
|
||||
.map { groupedByUser ->
|
||||
val userId = groupedByUser.key
|
||||
val wedgeSenderKeysForUser = groupedByUser.value.map { it.senderKey }
|
||||
|
|
Loading…
Reference in a new issue