If media source for thumbnail info is not available for image, use the source image as a fallback. But if it is available, use it.
This commit is contained in:
parent
d2483ea11a
commit
ea9b222b0e
3 changed files with 3 additions and 3 deletions
|
|
@ -311,7 +311,7 @@ class MessagesPresenter @AssistedInject constructor(
|
||||||
val textContent = messageSummaryFormatter.format(targetEvent)
|
val textContent = messageSummaryFormatter.format(targetEvent)
|
||||||
val attachmentThumbnailInfo = when (targetEvent.content) {
|
val attachmentThumbnailInfo = when (targetEvent.content) {
|
||||||
is TimelineItemImageContent -> AttachmentThumbnailInfo(
|
is TimelineItemImageContent -> AttachmentThumbnailInfo(
|
||||||
thumbnailSource = targetEvent.content.thumbnailSource,
|
thumbnailSource = targetEvent.content.thumbnailSource ?: targetEvent.content.mediaSource,
|
||||||
textContent = targetEvent.content.body,
|
textContent = targetEvent.content.body,
|
||||||
type = AttachmentThumbnailType.Image,
|
type = AttachmentThumbnailType.Image,
|
||||||
blurHash = targetEvent.content.blurhash,
|
blurHash = targetEvent.content.blurhash,
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ private fun MessageSummary(event: TimelineItem.Event, modifier: Modifier = Modif
|
||||||
AttachmentThumbnail(
|
AttachmentThumbnail(
|
||||||
modifier = imageModifier,
|
modifier = imageModifier,
|
||||||
info = AttachmentThumbnailInfo(
|
info = AttachmentThumbnailInfo(
|
||||||
thumbnailSource = event.content.mediaSource,
|
thumbnailSource = event.content.thumbnailSource ?: event.content.mediaSource,
|
||||||
textContent = textContent,
|
textContent = textContent,
|
||||||
type = AttachmentThumbnailType.Image,
|
type = AttachmentThumbnailType.Image,
|
||||||
blurHash = event.content.blurhash,
|
blurHash = event.content.blurhash,
|
||||||
|
|
|
||||||
|
|
@ -595,7 +595,7 @@ private fun attachmentThumbnailInfoForInReplyTo(inReplyTo: InReplyTo.Ready): Att
|
||||||
val messageContent = inReplyTo.content as? MessageContent ?: return null
|
val messageContent = inReplyTo.content as? MessageContent ?: return null
|
||||||
return when (val type = messageContent.type) {
|
return when (val type = messageContent.type) {
|
||||||
is ImageMessageType -> AttachmentThumbnailInfo(
|
is ImageMessageType -> AttachmentThumbnailInfo(
|
||||||
thumbnailSource = type.info?.thumbnailSource,
|
thumbnailSource = type.info?.thumbnailSource ?: type.source,
|
||||||
textContent = messageContent.body,
|
textContent = messageContent.body,
|
||||||
type = AttachmentThumbnailType.Image,
|
type = AttachmentThumbnailType.Image,
|
||||||
blurHash = type.info?.blurhash,
|
blurHash = type.info?.blurhash,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue