Fix issue where links do not render in stories if previews are off.

This commit is contained in:
Alex Hart 2023-01-13 14:36:05 -04:00 committed by Cody Henthorne
parent 760ace93d4
commit 8fd378db4e
2 changed files with 2 additions and 2 deletions

View file

@ -251,7 +251,7 @@ class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creati
return if (linkPreviewState.linkPreview.isPresent) {
linkPreviewState.linkPreview.get()
} else if (!linkPreviewState.activeUrlForError.isNullOrEmpty()) {
LinkPreview(linkPreviewState.activeUrlForError!!, "", "", 0L, Optional.empty())
LinkPreview(linkPreviewState.activeUrlForError!!, linkPreviewState.activeUrlForError!!, "", 0L, Optional.empty())
} else {
null
}

View file

@ -3081,7 +3081,7 @@ public final class MessageContentProcessor {
LinkPreview linkPreview = new LinkPreview(url.get(), title.orElse(""), description.orElse(""), preview.getDate(), thumbnail);
linkPreviews.add(linkPreview);
} else {
warn(String.format("Discarding an invalid link preview. hasTitle: %b presentInBody: %b validDomain: %b", hasTitle, presentInBody, validDomain));
warn(String.format("Discarding an invalid link preview. hasTitle: %b presentInBody: %b isStoryEmbed: %b validDomain: %b", hasTitle, presentInBody, isStoryEmbed, validDomain));
}
}