forked from GitHub-Mirror/riotX-android
Download file - typo
This commit is contained in:
@ -51,4 +51,4 @@ data class MessageAudioContent(
|
||||
* Required if the file is encrypted. Information on the encrypted file, as specified in End-to-end encryption.
|
||||
*/
|
||||
@Json(name = "file") override val encryptedFileInfo: EncryptedFileInfo? = null
|
||||
) : MessageEncyptedContent
|
||||
) : MessageEncryptedContent
|
||||
|
@ -22,6 +22,6 @@ import im.vector.matrix.android.internal.crypto.model.rest.EncryptedFileInfo
|
||||
/**
|
||||
* Interface for message which can contains encrypted data
|
||||
*/
|
||||
interface MessageEncyptedContent : MessageContent {
|
||||
interface MessageEncryptedContent : MessageContent {
|
||||
val encryptedFileInfo: EncryptedFileInfo?
|
||||
}
|
@ -16,6 +16,7 @@
|
||||
|
||||
package im.vector.matrix.android.api.session.room.model.message
|
||||
|
||||
import android.content.ClipDescription
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import im.vector.matrix.android.api.session.events.model.Content
|
||||
@ -53,4 +54,16 @@ data class MessageFileContent(
|
||||
@Json(name = "m.new_content") override val newContent: Content? = null,
|
||||
|
||||
@Json(name = "file") override val encryptedFileInfo: EncryptedFileInfo? = null
|
||||
) : MessageEncyptedContent
|
||||
) : MessageEncryptedContent {
|
||||
|
||||
fun getMimeType(): String {
|
||||
// Mimetype default to plain text, should not be used
|
||||
return encryptedFileInfo?.mimetype
|
||||
?: info?.mimeType
|
||||
?: ClipDescription.MIMETYPE_TEXT_PLAIN
|
||||
}
|
||||
|
||||
fun getFileName(): String {
|
||||
return filename ?: body
|
||||
}
|
||||
}
|
@ -52,4 +52,4 @@ data class MessageImageContent(
|
||||
* Required if the file is encrypted. Information on the encrypted file, as specified in End-to-end encryption.
|
||||
*/
|
||||
@Json(name = "file") override val encryptedFileInfo: EncryptedFileInfo? = null
|
||||
) : MessageEncyptedContent
|
||||
) : MessageEncryptedContent
|
@ -51,4 +51,4 @@ data class MessageVideoContent(
|
||||
* Required if the file is encrypted. Information on the encrypted file, as specified in End-to-end encryption.
|
||||
*/
|
||||
@Json(name = "file") override val encryptedFileInfo: EncryptedFileInfo? = null
|
||||
) : MessageEncyptedContent
|
||||
) : MessageEncryptedContent
|
Reference in New Issue
Block a user