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)
|
@Throws(CryptoStoreErrorException::class)
|
||||||
suspend fun getUserDevices(userId: String): List<CryptoDeviceInfo> {
|
suspend fun getUserDevices(userId: String): List<CryptoDeviceInfo> {
|
||||||
val ownDevice = ownDevice()
|
|
||||||
val devices = inner.getUserDevices(userId).map { toCryptoDeviceInfo(it) }.toMutableList()
|
val devices = inner.getUserDevices(userId).map { toCryptoDeviceInfo(it) }.toMutableList()
|
||||||
|
|
||||||
// EA doesn't differentiate much between our own and other devices of
|
// EA doesn't differentiate much between our own and other devices of
|
||||||
// while the rust-sdk does, append our own device here.
|
// while the rust-sdk does, append our own device here.
|
||||||
|
val ownDevice = this.ownDevice()
|
||||||
|
|
||||||
|
if (userId == ownDevice.userId) {
|
||||||
devices.add(ownDevice)
|
devices.add(ownDevice)
|
||||||
|
}
|
||||||
|
|
||||||
return devices
|
return devices
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user