mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Use SDK API to build room and event permalinks.
This commit is contained in:
committed by
Benoit Marty
parent
7b14a0e4c8
commit
294f1f2d96
-5
@@ -16,17 +16,12 @@
|
||||
|
||||
package io.element.android.libraries.matrix.api.permalink
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
|
||||
interface PermalinkBuilder {
|
||||
fun permalinkForUser(userId: UserId): Result<String>
|
||||
fun permalinkForRoomAlias(roomAlias: String): Result<String>
|
||||
fun permalinkForRoomId(roomId: RoomId): Result<String>
|
||||
}
|
||||
|
||||
sealed class PermalinkBuilderError : Throwable() {
|
||||
data object InvalidRoomAlias : PermalinkBuilderError()
|
||||
data object InvalidRoomId : PermalinkBuilderError()
|
||||
data object InvalidUserId : PermalinkBuilderError()
|
||||
}
|
||||
|
||||
+5
@@ -317,6 +317,11 @@ interface MatrixRoom : Closeable {
|
||||
*/
|
||||
fun getWidgetDriver(widgetSettings: MatrixWidgetSettings): Result<MatrixWidgetDriver>
|
||||
|
||||
/**
|
||||
* Get the permalink for the room.
|
||||
*/
|
||||
suspend fun getPermalink(): Result<String>
|
||||
|
||||
/**
|
||||
* Get the permalink for the provided [eventId].
|
||||
* @param eventId The event id to get the permalink for.
|
||||
|
||||
Reference in New Issue
Block a user