mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
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:
+1
-1
@@ -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,
|
||||||
|
|||||||
+1
-1
@@ -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,
|
||||||
|
|||||||
+1
-1
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user