Parse permalink using parseMatrixEntityFrom.
Create new PermalinkData type for link to Events. Keep matrixToConverter for now to first convert to matrix.to link. At some point it may be done by the SDK. Remove parse(Uri)
This commit is contained in:
parent
89d2f43b1a
commit
3df328b1ab
14 changed files with 125 additions and 241 deletions
|
|
@ -17,7 +17,6 @@
|
|||
package io.element.android.features.messages.impl
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.ui.Modifier
|
||||
|
|
@ -108,13 +107,19 @@ class MessagesNode @AssistedInject constructor(
|
|||
context: Context,
|
||||
url: String,
|
||||
) {
|
||||
when (val permalink = permalinkParser.parse(Uri.parse(url))) {
|
||||
when (val permalink = permalinkParser.parse(url)) {
|
||||
is PermalinkData.UserLink -> {
|
||||
callback?.onUserDataClicked(UserId(permalink.userId))
|
||||
callback?.onUserDataClicked(permalink.userId)
|
||||
}
|
||||
is PermalinkData.RoomLink -> {
|
||||
// TODO Implement room link handling
|
||||
}
|
||||
is PermalinkData.EventIdAliasLink -> {
|
||||
// TODO Implement room and Event link handling
|
||||
}
|
||||
is PermalinkData.EventIdLink -> {
|
||||
// TODO Implement room and Event link handling
|
||||
}
|
||||
is PermalinkData.FallbackLink,
|
||||
is PermalinkData.RoomEmailInviteLink -> {
|
||||
context.openUrlInExternalApp(url)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package io.element.android.features.messages.impl.messagecomposer
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
||||
import io.element.android.features.messages.impl.mentions.MentionSuggestion
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
|
|
@ -49,7 +48,6 @@ fun aMessageComposerState(
|
|||
richTextEditorState = richTextEditorState,
|
||||
permalinkParser = object : PermalinkParser {
|
||||
override fun parse(uriString: String): PermalinkData = TODO()
|
||||
override fun parse(uri: Uri): PermalinkData = TODO()
|
||||
},
|
||||
isFullScreen = isFullScreen,
|
||||
mode = mode,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue