store attachment uri as a string

This commit is contained in:
tibbi 2020-12-21 15:29:10 +01:00
parent ceb9896988
commit 4cad413478
5 changed files with 9 additions and 7 deletions

View file

@ -262,10 +262,10 @@ fun Context.getMmsAttachment(id: Long): MessageAttachment {
if (mimetype == "text/plain") {
messageAttachment.text = cursor.getStringValue(Mms.Part.TEXT) ?: ""
} else if (mimetype.startsWith("image/") || mimetype.startsWith("video/")) {
val attachment = Attachment(Uri.withAppendedPath(uri, partId), mimetype, 0, 0, "")
val attachment = Attachment(Uri.withAppendedPath(uri, partId).toString(), mimetype, 0, 0, "")
messageAttachment.attachments.add(attachment)
} else if (mimetype != "application/smil") {
val attachment = Attachment(Uri.withAppendedPath(uri, partId), mimetype, 0, 0, attachmentName)
val attachment = Attachment(Uri.withAppendedPath(uri, partId).toString(), mimetype, 0, 0, attachmentName)
messageAttachment.attachments.add(attachment)
} else {
val text = cursor.getStringValue(Mms.Part.TEXT)