Merge pull request #2653 from element-hq/feature/bma/copyPermalink
Copy permalink
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package io.element.android.libraries.matrix.impl.room
|
||||
|
||||
import io.element.android.appconfig.MatrixConfiguration
|
||||
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
|
||||
import io.element.android.libraries.core.coroutine.childScope
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
@@ -711,6 +712,19 @@ class RustMatrixRoom(
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getPermalinkFor(eventId: EventId): Result<String> {
|
||||
// FIXME Use the SDK API once https://github.com/matrix-org/matrix-rust-sdk/issues/3259 has been done
|
||||
// Now use a simple builder
|
||||
return runCatching {
|
||||
buildString {
|
||||
append(MatrixConfiguration.MATRIX_TO_PERMALINK_BASE_URL)
|
||||
append(roomId.value)
|
||||
append("/")
|
||||
append(eventId.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendAttachment(files: List<File>, handle: () -> SendAttachmentJoinHandle): Result<MediaUploadHandler> {
|
||||
return runCatching {
|
||||
MediaUploadHandlerImpl(files, handle())
|
||||
|
||||
Reference in New Issue
Block a user