Fixed sent content type
This commit is contained in:
parent
02501f0804
commit
52b5a81c26
1 changed files with 6 additions and 4 deletions
|
@ -287,10 +287,12 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
|||
for (attachment in attachments.value.orEmpty()) {
|
||||
val content = Factory.instance().createContent()
|
||||
|
||||
if (attachment.isImage) {
|
||||
content.type = "image"
|
||||
} else {
|
||||
content.type = "file"
|
||||
content.type = when {
|
||||
attachment.isImage -> "image"
|
||||
attachment.isAudio -> "audio"
|
||||
attachment.isVideo -> "video"
|
||||
attachment.isPdf -> "application"
|
||||
else -> "file"
|
||||
}
|
||||
content.subtype = FileUtils.getExtensionFromFileName(attachment.fileName)
|
||||
content.name = attachment.fileName
|
||||
|
|
Loading…
Reference in a new issue