mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:01:40 +00:00
Use SDK API to build room and event permalinks.
This commit is contained in:
committed by
Benoit Marty
parent
7b14a0e4c8
commit
294f1f2d96
-9
@@ -16,7 +16,6 @@
|
||||
|
||||
package io.element.android.libraries.matrix.test.permalink
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
import io.element.android.libraries.matrix.api.permalink.PermalinkBuilder
|
||||
|
||||
@@ -26,12 +25,4 @@ class FakePermalinkBuilder(
|
||||
override fun permalinkForUser(userId: UserId): Result<String> {
|
||||
return result()
|
||||
}
|
||||
|
||||
override fun permalinkForRoomAlias(roomAlias: String): Result<String> {
|
||||
return result()
|
||||
}
|
||||
|
||||
override fun permalinkForRoomId(roomId: RoomId): Result<String> {
|
||||
return result()
|
||||
}
|
||||
}
|
||||
|
||||
+7
-2
@@ -84,7 +84,8 @@ class FakeMatrixRoom(
|
||||
override val activeMemberCount: Long = 234L,
|
||||
val notificationSettingsService: NotificationSettingsService = FakeNotificationSettingsService(),
|
||||
private val matrixTimeline: MatrixTimeline = FakeMatrixTimeline(),
|
||||
private var permalinkResult: () -> Result<String> = { Result.success("link") },
|
||||
private var roomPermalinkResult: () -> Result<String> = { Result.success("room link") },
|
||||
private var eventPermalinkResult: (EventId) -> Result<String> = { Result.success("event link") },
|
||||
canRedactOwn: Boolean = false,
|
||||
canRedactOther: Boolean = false,
|
||||
) : MatrixRoom {
|
||||
@@ -278,8 +279,12 @@ class FakeMatrixRoom(
|
||||
return cancelSendResult
|
||||
}
|
||||
|
||||
override suspend fun getPermalink(): Result<String> {
|
||||
return roomPermalinkResult()
|
||||
}
|
||||
|
||||
override suspend fun getPermalinkFor(eventId: EventId): Result<String> {
|
||||
return permalinkResult()
|
||||
return eventPermalinkResult(eventId)
|
||||
}
|
||||
|
||||
override suspend fun editMessage(
|
||||
|
||||
Reference in New Issue
Block a user