private fun getAttachmentsFromMetaData(metaData: List<AttachmentMetaData>): List<Attachment> { return metaData.map { val fileFromUri = storageHelper.getCachedFileFromUri(context, it) Attachment( upload = fileFromUri, type = it.type, name = it.title ?: fileFromUri.name ?: "", fileSize = it.size.toInt(), mimeType = it.mimeType ) } }
Loads attachment files from the provided metadata, so that we can upload them.