diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/ImageInfo.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/ImageInfo.kt index deadcc3f34..c38ef5bc27 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/ImageInfo.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/ImageInfo.kt @@ -40,7 +40,7 @@ data class ImageInfo( /** * Size of the image in bytes. */ - @Json(name = "size") val size: Int = 0, + @Json(name = "size") val size: Long = 0, /** * Metadata about the image referred to in thumbnail_url. diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/content/UploadContentWorker.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/content/UploadContentWorker.kt index 4b84b9f9c5..305d7b9e70 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/content/UploadContentWorker.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/content/UploadContentWorker.kt @@ -392,7 +392,7 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter info = info?.copy( width = newAttachmentAttributes?.newWidth ?: info.width, height = newAttachmentAttributes?.newHeight ?: info.height, - size = newAttachmentAttributes?.newFileSize?.toInt() ?: info.size + size = newAttachmentAttributes?.newFileSize ?: info.size ) ) } 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 7cc238fcc9..449189e6b5 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 @@ -141,7 +141,7 @@ internal class DefaultSendService @AssistedInject constructor( is MessageImageContent -> { // The image has not yet been sent val attachmentData = ContentAttachmentData( - size = messageContent.info!!.size.toLong(), + size = messageContent.info!!.size, mimeType = messageContent.info.mimeType!!, width = messageContent.info.width.toLong(), height = messageContent.info.height.toLong(), 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 432a4af062..c1ad6205c3 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 @@ -244,7 +244,7 @@ internal class LocalEchoEventFactory @Inject constructor( mimeType = attachment.getSafeMimeType(), width = width?.toInt() ?: 0, height = height?.toInt() ?: 0, - size = attachment.size.toInt() + size = attachment.size ), url = attachment.queryUri.toString() )