From 7d535df9cf18aa994062a1f02c2b29dc2bc348f1 Mon Sep 17 00:00:00 2001 From: k1ngsterr1 Date: Sun, 25 Jan 2026 17:23:53 +0500 Subject: [PATCH] fix: Correct attachment type mapping for images and files in ChatsListViewModel --- .../com/rosetta/messenger/ui/chats/ChatsListViewModel.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListViewModel.kt b/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListViewModel.kt index e24be6b..430931d 100644 --- a/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListViewModel.kt +++ b/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListViewModel.kt @@ -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