fix: Correct attachment type mapping for images and files in ChatsListViewModel

This commit is contained in:
k1ngsterr1
2026-01-25 17:23:53 +05:00
parent 5c485a3ef1
commit 7d535df9cf

View File

@@ -157,8 +157,8 @@ class ChatsListViewModel(application: Application) : AndroidViewModel(applicatio
val firstAttachment = attachments.getJSONObject(0)
val type = firstAttachment.optInt("type", -1)
when (type) {
2 -> "Photo" // AttachmentType.IMAGE
3 -> "File" // AttachmentType.FILE
0 -> "Photo" // AttachmentType.IMAGE = 0
2 -> "File" // AttachmentType.FILE = 2
else -> null
}
} else null
@@ -240,8 +240,8 @@ class ChatsListViewModel(application: Application) : AndroidViewModel(applicatio
val firstAttachment = attachments.getJSONObject(0)
val type = firstAttachment.optInt("type", -1)
when (type) {
2 -> "Photo" // AttachmentType.IMAGE
3 -> "File" // AttachmentType.FILE
0 -> "Photo" // AttachmentType.IMAGE = 0
2 -> "File" // AttachmentType.FILE = 2
else -> null
}
} else null