FIx / Audio icon not shown after download

This commit is contained in:
Valere 2020-08-07 16:51:33 +02:00
parent de53166193
commit 8b8855d2d5
1 changed files with 10 additions and 2 deletions

View File

@ -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)