mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Add support for received call link previews.
This commit is contained in:
@@ -15,6 +15,7 @@ import org.thoughtcrime.securesms.attachments.Attachment
|
||||
import org.thoughtcrime.securesms.attachments.PointerAttachment
|
||||
import org.thoughtcrime.securesms.attachments.TombstoneAttachment
|
||||
import org.thoughtcrime.securesms.attachments.UriAttachment
|
||||
import org.thoughtcrime.securesms.calls.links.CallLinks
|
||||
import org.thoughtcrime.securesms.components.emoji.EmojiUtil
|
||||
import org.thoughtcrime.securesms.contactshare.Contact
|
||||
import org.thoughtcrime.securesms.contactshare.ContactModelMapper
|
||||
@@ -1117,8 +1118,9 @@ object DataMessageProcessor {
|
||||
val hasTitle = !TextUtils.isEmpty(title.orElse(""))
|
||||
val presentInBody = url.isPresent && urlsInMessage.containsUrl(url.get())
|
||||
val validDomain = url.isPresent && LinkUtil.isValidPreviewUrl(url.get())
|
||||
val isForCallLink = url.isPresent && CallLinks.isCallLink(url.get())
|
||||
|
||||
if (hasTitle && (presentInBody || isStoryEmbed) && validDomain) {
|
||||
if ((hasTitle || isForCallLink) && (presentInBody || isStoryEmbed) && validDomain) {
|
||||
val linkPreview = LinkPreview(url.get(), title.orElse(""), description.orElse(""), preview.date, thumbnail.toOptional())
|
||||
linkPreview
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user