Fix improper filename on sent media items.

This commit is contained in:
Alex Hart
2025-10-07 11:00:15 -03:00
parent 585fb3eea8
commit fe17e01ff5
2 changed files with 3 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ data class Media(
val bucketId: String?,
val caption: String?,
val transformProperties: TransformProperties?,
val fileName: String?
var fileName: String?
) : Parcelable {
companion object {
const val ALL_MEDIA_BUCKET_ID: String = "org.thoughtcrime.securesms.ALL_MEDIA"

View File

@@ -52,6 +52,7 @@ class MediaSendDocumentFragment : Fragment(R.layout.mediasend_document_fragment)
val fileInfo: Pair<String?, Long>? = getFileInfo()
if (fileInfo != null) {
media.fileName = fileInfo.first
name.text = fileInfo.first ?: getString(R.string.DocumentView_unnamed_file)
size.text = fileInfo.second.bytes.toUnitString()
@@ -125,6 +126,7 @@ class MediaSendDocumentFragment : Fragment(R.layout.mediasend_document_fragment)
if (cursor != null && cursor.moveToFirst()) {
val fileName = cursor.getString(cursor.getColumnIndexOrThrow(OpenableColumns.DISPLAY_NAME))
val fileSize = cursor.getLong(cursor.getColumnIndexOrThrow(OpenableColumns.SIZE))
media.fileName = fileName
return Pair(fileName, fileSize)
}