mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25: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
|
||||
private fun openURL() {
|
||||
val url = this.url ?: return Log.w("LinkPreviewView", "Cannot open a null URL")
|
||||
val activity = context as ConversationActivityV2
|
||||
activity.showOpenUrlDialog(url)
|
||||
val activity = context as? ConversationActivityV2
|
||||
activity?.showOpenUrlDialog(url)
|
||||
}
|
||||
// endregion
|
||||
}
|
@ -287,8 +287,8 @@ class VisibleMessageContentView : ConstraintLayout {
|
||||
body.getSpans<URLSpan>(0, body.length).toList().forEach { urlSpan ->
|
||||
val updatedUrl = urlSpan.url.let { it.toHttpUrlOrNull().toString() }
|
||||
val replacementSpan = ModalURLSpan(updatedUrl) { url ->
|
||||
val activity = context as ConversationActivityV2
|
||||
activity.showOpenUrlDialog(url)
|
||||
val activity = context as? ConversationActivityV2
|
||||
activity?.showOpenUrlDialog(url)
|
||||
}
|
||||
val start = body.getSpanStart(urlSpan)
|
||||
val end = body.getSpanEnd(urlSpan)
|
||||
|
Loading…
Reference in New Issue
Block a user