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()) {
|
for (attachment in attachments.value.orEmpty()) {
|
||||||
val content = Factory.instance().createContent()
|
val content = Factory.instance().createContent()
|
||||||
|
|
||||||
if (attachment.isImage) {
|
content.type = when {
|
||||||
content.type = "image"
|
attachment.isImage -> "image"
|
||||||
} else {
|
attachment.isAudio -> "audio"
|
||||||
content.type = "file"
|
attachment.isVideo -> "video"
|
||||||
|
attachment.isPdf -> "application"
|
||||||
|
else -> "file"
|
||||||
}
|
}
|
||||||
content.subtype = FileUtils.getExtensionFromFileName(attachment.fileName)
|
content.subtype = FileUtils.getExtensionFromFileName(attachment.fileName)
|
||||||
content.name = attachment.fileName
|
content.name = attachment.fileName
|
||||||
|
|
Loading…
Reference in a new issue