Use Long for size like for the other models (FileInfo, AudioInfo, VideoInfo)

This commit is contained in:
Benoit Marty 2021-05-04 13:35:03 +02:00
parent bcf6dcbf70
commit c502e971a1
4 changed files with 4 additions and 4 deletions

View File

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

View File

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

View File

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

View File

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