From 5ab9e0514fb12ca93f52e0f91f2f18a3b58ccf85 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 4 May 2021 21:00:06 +0200 Subject: [PATCH] Use interface field --- .../sdk/internal/session/room/send/DefaultSendService.kt | 6 +++--- .../home/room/detail/timeline/factory/MessageItemFactory.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt index 26a87557ff4..6f86b07c2a4 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt @@ -150,7 +150,7 @@ internal class DefaultSendService @AssistedInject constructor( // The image has not yet been sent val attachmentData = ContentAttachmentData( size = messageContent.info!!.size.toLong(), - mimeType = messageContent.info.mimeType!!, + mimeType = messageContent.mimeType, width = messageContent.info.width.toLong(), height = messageContent.info.height.toLong(), name = messageContent.body, @@ -177,7 +177,7 @@ internal class DefaultSendService @AssistedInject constructor( is MessageFileContent -> { val attachmentData = ContentAttachmentData( size = messageContent.info!!.size, - mimeType = messageContent.info.mimeType!!, + mimeType = messageContent.mimeType, name = messageContent.getFileName(), queryUri = Uri.parse(messageContent.url), type = ContentAttachmentData.Type.FILE @@ -189,7 +189,7 @@ internal class DefaultSendService @AssistedInject constructor( val attachmentData = ContentAttachmentData( size = messageContent.audioInfo?.size ?: 0, duration = messageContent.audioInfo?.duration?.toLong() ?: 0L, - mimeType = messageContent.audioInfo?.mimeType, + mimeType = messageContent.mimeType, name = messageContent.body, queryUri = Uri.parse(messageContent.url), type = ContentAttachmentData.Type.AUDIO 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 0f214ffb133..4363bbda499 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 @@ -312,7 +312,7 @@ class MessageItemFactory @Inject constructor( .leftGuideline(avatarSizeProvider.leftGuideline) .imageContentRenderer(imageContentRenderer) .contentUploadStateTrackerBinder(contentUploadStateTrackerBinder) - .playable(messageContent.info?.mimeType == MimeTypes.Gif) + .playable(messageContent.mimeType == MimeTypes.Gif) .highlighted(highlight) .mediaData(data) .apply {