mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 10:35:19 +00:00
For safety
This commit is contained in:
parent
0b1a71a582
commit
116bef3c71
@ -87,8 +87,8 @@ class LinkPreviewView : LinearLayout {
|
|||||||
// Method to show the open or copy URL dialog
|
// Method to show the open or copy URL dialog
|
||||||
private fun openURL() {
|
private fun openURL() {
|
||||||
val url = this.url ?: return Log.w("LinkPreviewView", "Cannot open a null URL")
|
val url = this.url ?: return Log.w("LinkPreviewView", "Cannot open a null URL")
|
||||||
val activity = context as ConversationActivityV2
|
val activity = context as? ConversationActivityV2
|
||||||
activity.showOpenUrlDialog(url)
|
activity?.showOpenUrlDialog(url)
|
||||||
}
|
}
|
||||||
// endregion
|
// endregion
|
||||||
}
|
}
|
@ -287,8 +287,8 @@ class VisibleMessageContentView : ConstraintLayout {
|
|||||||
body.getSpans<URLSpan>(0, body.length).toList().forEach { urlSpan ->
|
body.getSpans<URLSpan>(0, body.length).toList().forEach { urlSpan ->
|
||||||
val updatedUrl = urlSpan.url.let { it.toHttpUrlOrNull().toString() }
|
val updatedUrl = urlSpan.url.let { it.toHttpUrlOrNull().toString() }
|
||||||
val replacementSpan = ModalURLSpan(updatedUrl) { url ->
|
val replacementSpan = ModalURLSpan(updatedUrl) { url ->
|
||||||
val activity = context as ConversationActivityV2
|
val activity = context as? ConversationActivityV2
|
||||||
activity.showOpenUrlDialog(url)
|
activity?.showOpenUrlDialog(url)
|
||||||
}
|
}
|
||||||
val start = body.getSpanStart(urlSpan)
|
val start = body.getSpanStart(urlSpan)
|
||||||
val end = body.getSpanEnd(urlSpan)
|
val end = body.getSpanEnd(urlSpan)
|
||||||
|
Loading…
Reference in New Issue
Block a user