fix: Correct attachment type mapping for images and files in ChatsListViewModel
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user