mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 16:33:39 +00:00
fix: ASCIIfy the URL open dialog's content. fixes #681
This commit is contained in:
parent
4d5296bb1c
commit
71d186ad59
@ -41,6 +41,7 @@ import org.thoughtcrime.securesms.mms.GlideRequests
|
||||
import org.thoughtcrime.securesms.util.SearchUtil
|
||||
import org.thoughtcrime.securesms.util.SearchUtil.StyleFactory
|
||||
import org.thoughtcrime.securesms.util.UiModeUtilities
|
||||
import java.net.IDN
|
||||
import java.util.*
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@ -212,7 +213,8 @@ class VisibleMessageContentView : LinearLayout {
|
||||
|
||||
// replace URLSpans with ModalURLSpans
|
||||
body.getSpans<URLSpan>(0, body.length).toList().forEach { urlSpan ->
|
||||
val replacementSpan = ModalURLSpan(urlSpan.url) { url ->
|
||||
val updatedUrl = urlSpan.url.let(IDN::toASCII)
|
||||
val replacementSpan = ModalURLSpan(updatedUrl) { url ->
|
||||
val activity = context as AppCompatActivity
|
||||
OpenURLDialog(url).show(activity.supportFragmentManager, "Open URL Dialog")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user