mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-30 15:50:53 +08:00
crypto: Only add our own devices if we're requesting devices for our own user
This commit is contained in:
parent
80e80e07b3
commit
d4090c4b0a
@ -619,12 +619,15 @@ internal class OlmMachine(
|
||||
*/
|
||||
@Throws(CryptoStoreErrorException::class)
|
||||
suspend fun getUserDevices(userId: String): List<CryptoDeviceInfo> {
|
||||
val ownDevice = ownDevice()
|
||||
val devices = inner.getUserDevices(userId).map { toCryptoDeviceInfo(it) }.toMutableList()
|
||||
|
||||
// EA doesn't differentiate much between our own and other devices of
|
||||
// while the rust-sdk does, append our own device here.
|
||||
devices.add(ownDevice)
|
||||
val ownDevice = this.ownDevice()
|
||||
|
||||
if (userId == ownDevice.userId) {
|
||||
devices.add(ownDevice)
|
||||
}
|
||||
|
||||
return devices
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user