diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt index cce3248551..97bc693f26 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt @@ -187,10 +187,18 @@ class MessageItemFactory @Inject constructor( informationData: MessageInformationData, highlight: Boolean, attributes: AbsMessageItem.Attributes): MessageFileItem? { + val fileUrl = messageContent.getFileUrl()?.let { + if (informationData.sentByMe && !informationData.sendState.isSent()) { + it + } else { + it.takeIf { it.startsWith("mxc://") } + } + } ?: "" return MessageFileItem_() .attributes(attributes) - .izLocalFile(messageContent.getFileUrl().isLocalFile()) - .mxcUrl(messageContent.getFileUrl() ?: "") + .izLocalFile(fileUrl.isLocalFile()) + .izDownloaded(session.fileService().isFileInCache(fileUrl, messageContent.mimeType)) + .mxcUrl(fileUrl) .contentUploadStateTrackerBinder(contentUploadStateTrackerBinder) .contentDownloadStateTrackerBinder(contentDownloadStateTrackerBinder) .highlighted(highlight)