mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Introduce value class "DeviceId"
This commit is contained in:
+2
-1
@@ -7,6 +7,7 @@
|
||||
|
||||
package io.element.android.libraries.matrix.api
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.DeviceId
|
||||
import io.element.android.libraries.matrix.api.core.ProgressCallback
|
||||
import io.element.android.libraries.matrix.api.core.RoomAlias
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
@@ -41,7 +42,7 @@ import java.util.Optional
|
||||
|
||||
interface MatrixClient : Closeable {
|
||||
val sessionId: SessionId
|
||||
val deviceId: String
|
||||
val deviceId: DeviceId
|
||||
val userProfile: StateFlow<MatrixUser>
|
||||
val roomListService: RoomListService
|
||||
val mediaLoader: MatrixMediaLoader
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright 2024 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.api.core
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
@JvmInline
|
||||
value class DeviceId(val value: String) : Serializable {
|
||||
override fun toString(): String = value
|
||||
}
|
||||
+4
-2
@@ -7,9 +7,11 @@
|
||||
|
||||
package io.element.android.libraries.matrix.api.oidc
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.DeviceId
|
||||
|
||||
sealed interface AccountManagementAction {
|
||||
data object Profile : AccountManagementAction
|
||||
data object SessionsList : AccountManagementAction
|
||||
data class SessionView(val deviceId: String) : AccountManagementAction
|
||||
data class SessionEnd(val deviceId: String) : AccountManagementAction
|
||||
data class SessionView(val deviceId: DeviceId) : AccountManagementAction
|
||||
data class SessionEnd(val deviceId: DeviceId) : AccountManagementAction
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user