From b9d2e93ce2ba2b97c85f493733140095c00bf604 Mon Sep 17 00:00:00 2001
From: Taras Smakula <tarassmakula@gmail.com>
Date: Tue, 11 Apr 2023 18:01:52 +0300
Subject: [PATCH] Update mappings

---
 .../sdk/internal/session/room/send/DefaultSendService.kt    | 6 ++++--
 .../sdk/internal/session/room/send/LocalEchoEventFactory.kt | 6 ++++--
 2 files changed, 8 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 d29e7d8f..fbbca9ae 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
@@ -178,7 +178,8 @@ internal class DefaultSendService @AssistedInject constructor(
                             height = messageContent.info.height.toLong(),
                             name = messageContent.body,
                             queryUri = Uri.parse(messageContent.url),
-                            type = ContentAttachmentData.Type.IMAGE
+                            type = ContentAttachmentData.Type.IMAGE,
+                            blurHash = messageContent.info.blurHash
                     )
                     localEchoRepository.updateSendState(localEcho.eventId, roomId, SendState.UNSENT)
                     internalSendMedia(listOf(localEcho.root), attachmentData, true)
@@ -192,7 +193,8 @@ internal class DefaultSendService @AssistedInject constructor(
                             duration = messageContent.videoInfo?.duration?.toLong(),
                             name = messageContent.body,
                             queryUri = Uri.parse(messageContent.url),
-                            type = ContentAttachmentData.Type.VIDEO
+                            type = ContentAttachmentData.Type.VIDEO,
+                            blurHash = messageContent.videoInfo?.blurHash
                     )
                     localEchoRepository.updateSendState(localEcho.eventId, roomId, SendState.UNSENT)
                     internalSendMedia(listOf(localEcho.root), attachmentData, true)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt
index c2bdec35..6e9ded60 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt
@@ -434,7 +434,8 @@ internal class LocalEchoEventFactory @Inject constructor(
                         mimeType = attachment.getSafeMimeType(),
                         width = width?.toInt() ?: 0,
                         height = height?.toInt() ?: 0,
-                        size = attachment.size
+                        size = attachment.size,
+                        blurHash = attachment.blurHash
                 ),
                 url = attachment.queryUri.toString(),
                 relatesTo = relatesTo ?: rootThreadEventId?.let { generateThreadRelationContent(it) }
@@ -477,7 +478,8 @@ internal class LocalEchoEventFactory @Inject constructor(
                         duration = attachment.duration?.toInt() ?: 0,
                         // Glide will be able to use the local path and extract a thumbnail.
                         thumbnailUrl = attachment.queryUri.toString(),
-                        thumbnailInfo = thumbnailInfo
+                        thumbnailInfo = thumbnailInfo,
+                        blurHash = attachment.blurHash
                 ),
                 url = attachment.queryUri.toString(),
                 relatesTo = relatesTo ?: rootThreadEventId?.let { generateThreadRelationContent(it) }
-- 
GitLab