Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2025-07-21 14:43:32 +02:00
parent 5fb1ae4560
commit ee01481a1d
No known key found for this signature in database
GPG Key ID: F7AA2A8B65B50220

View File

@ -7,7 +7,6 @@
package com.nextcloud.talk.utils package com.nextcloud.talk.utils
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.text.method.ScrollingMovementMethod import android.text.method.ScrollingMovementMethod
@ -37,15 +36,11 @@ object MarkwonUtils {
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) { override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
builder.linkResolver(object : LinkResolverDef() { builder.linkResolver(object : LinkResolverDef() {
@SuppressLint("SuspiciousIndentation")
override fun resolve(view: View, link: String) { override fun resolve(view: View, link: String) {
var linkToOpen = link var linkToOpen = link
if (!(linkToOpen.contains("http://") || linkToOpen.contains("https://"))) { if (!(linkToOpen.contains("http://") || linkToOpen.contains("https://"))) {
linkToOpen = "https://$link" linkToOpen = "https://$link"
} else {
linkToOpen = link
} }
val browserIntent = Intent( val browserIntent = Intent(
Intent.ACTION_VIEW, Intent.ACTION_VIEW,
linkToOpen.toUri() linkToOpen.toUri()