Use SDK API to build room and event permalinks.
This commit is contained in:
parent
7b14a0e4c8
commit
294f1f2d96
9 changed files with 37 additions and 109 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue