mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-24 03:35:58 +00:00
Fix improper filename on sent media items.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user