mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Safe call to awaitCallback
This commit is contained in:
parent
6486b9e5cd
commit
bca24c0198
@ -16,12 +16,13 @@
|
||||
|
||||
package im.vector.app.features.raw.wellknown
|
||||
|
||||
import org.matrix.android.sdk.api.extensions.tryThis
|
||||
import org.matrix.android.sdk.api.raw.RawService
|
||||
import org.matrix.android.sdk.internal.util.awaitCallback
|
||||
|
||||
suspend fun RawService.getElementWellknown(userId: String): ElementWellKnown? {
|
||||
return awaitCallback<String> { getWellknown(userId, it) }
|
||||
.let { ElementWellKnownMapper.from(it) }
|
||||
return tryThis { awaitCallback<String> { getWellknown(userId, it) } }
|
||||
?.let { ElementWellKnownMapper.from(it) }
|
||||
}
|
||||
|
||||
fun ElementWellKnown.isE2EByDefault() = elementE2E?.e2eDefault ?: riotE2E?.e2eDefault ?: true
|
||||
|
Loading…
Reference in New Issue
Block a user