mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Merge pull request #1238 from vector-im/feature/thumbnail_info
`mimetype` field is optional
This commit is contained in:
commit
febadcc4f6
@ -31,6 +31,7 @@ Bugfix 🐛:
|
||||
- Cross-Signing | web <-> riotX After QR code scan, gossiping fails (#1210)
|
||||
- Fix crash when trying to download file without internet connection (#1229)
|
||||
- Local echo are not updated in timeline (for failed & encrypted states)
|
||||
- Render image event even if thumbnail_info does not have mimetype defined (#1209)
|
||||
|
||||
Translations 🗣:
|
||||
-
|
||||
|
@ -24,7 +24,7 @@ data class AudioInfo(
|
||||
/**
|
||||
* The mimetype of the audio e.g. "audio/aac".
|
||||
*/
|
||||
@Json(name = "mimetype") val mimeType: String,
|
||||
@Json(name = "mimetype") val mimeType: String?,
|
||||
|
||||
/**
|
||||
* The size of the audio clip in bytes.
|
||||
|
@ -39,5 +39,5 @@ data class ThumbnailInfo(
|
||||
/**
|
||||
* The mimetype of the image, e.g. "image/jpeg".
|
||||
*/
|
||||
@Json(name = "mimetype") val mimeType: String
|
||||
@Json(name = "mimetype") val mimeType: String?
|
||||
)
|
||||
|
@ -314,7 +314,7 @@ internal class LocalEchoEventFactory @Inject constructor(
|
||||
msgType = MessageType.MSGTYPE_AUDIO,
|
||||
body = attachment.name ?: "audio",
|
||||
audioInfo = AudioInfo(
|
||||
mimeType = attachment.getSafeMimeType()?.takeIf { it.isNotBlank() } ?: "audio/mpeg",
|
||||
mimeType = attachment.getSafeMimeType()?.takeIf { it.isNotBlank() },
|
||||
size = attachment.size
|
||||
),
|
||||
url = attachment.queryUri.toString()
|
||||
@ -327,8 +327,7 @@ internal class LocalEchoEventFactory @Inject constructor(
|
||||
msgType = MessageType.MSGTYPE_FILE,
|
||||
body = attachment.name ?: "file",
|
||||
info = FileInfo(
|
||||
mimeType = attachment.getSafeMimeType()?.takeIf { it.isNotBlank() }
|
||||
?: "application/octet-stream",
|
||||
mimeType = attachment.getSafeMimeType()?.takeIf { it.isNotBlank() },
|
||||
size = attachment.size
|
||||
),
|
||||
url = attachment.queryUri.toString()
|
||||
|
Loading…
Reference in New Issue
Block a user