mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-30 18:56:23 +00:00
Improved SIP URI pattern regex to prevent http URLS containing '@' to be handled as SIP URI
This commit is contained in:
parent
8f0f71d82b
commit
df8cd8c2cb
1 changed files with 1 additions and 1 deletions
|
|
@ -190,7 +190,7 @@ class ChatMessageData(val chatMessage: ChatMessage) : GenericContactData(chatMes
|
||||||
val spannable = Spannable.Factory.getInstance().newSpannable(content.utf8Text?.trim())
|
val spannable = Spannable.Factory.getInstance().newSpannable(content.utf8Text?.trim())
|
||||||
text.value = PatternClickableSpan()
|
text.value = PatternClickableSpan()
|
||||||
.add(
|
.add(
|
||||||
Pattern.compile("(?:<?sips?:)?[^@\\s]+(?:@([^\\s]+))+"),
|
Pattern.compile("(?:<?sips?:)?[a-zA-Z0-9+_.\\-]+(?:@([a-zA-Z0-9+_.\\-;=]+))+(>)?"),
|
||||||
object : PatternClickableSpan.SpannableClickedListener {
|
object : PatternClickableSpan.SpannableClickedListener {
|
||||||
override fun onSpanClicked(text: String) {
|
override fun onSpanClicked(text: String) {
|
||||||
Log.i("[Chat Message Data] Clicked on SIP URI: $text")
|
Log.i("[Chat Message Data] Clicked on SIP URI: $text")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue