Matrix rust sdk: update to 0.1.20 (and fix compilation issues)

This commit is contained in:
ganfra 2023-06-15 15:26:53 +02:00
parent 244306545f
commit d4526e52c6
8 changed files with 23 additions and 14 deletions

View file

@ -20,13 +20,13 @@ import io.element.android.libraries.matrix.api.media.AudioInfo
import org.matrix.rustcomponents.sdk.AudioInfo as RustAudioInfo
fun RustAudioInfo.map(): AudioInfo = AudioInfo(
duration = duration?.toLong(),
duration = duration,
size = size?.toLong(),
mimeType = mimetype
)
fun AudioInfo.map(): RustAudioInfo = RustAudioInfo(
duration = duration?.toULong(),
duration = duration,
size = size?.toULong(),
mimetype = mimeType,
)

View file

@ -20,7 +20,7 @@ import io.element.android.libraries.matrix.api.media.VideoInfo
import org.matrix.rustcomponents.sdk.VideoInfo as RustVideoInfo
fun RustVideoInfo.map(): VideoInfo = VideoInfo(
duration = duration?.toLong(),
duration = duration,
height = height?.toLong(),
width = width?.toLong(),
mimetype = mimetype,
@ -31,7 +31,7 @@ fun RustVideoInfo.map(): VideoInfo = VideoInfo(
)
fun VideoInfo.map(): RustVideoInfo = RustVideoInfo(
duration = duration?.toULong(),
duration = duration,
height = height?.toULong(),
width = width?.toULong(),
mimetype = mimetype,

View file

@ -103,7 +103,7 @@ private fun RustFormattedBody.map(): FormattedBody = FormattedBody(
private fun RustMessageFormat.map(): MessageFormat {
return when (this) {
RustMessageFormat.HTML -> MessageFormat.HTML
RustMessageFormat.UNKNOWN -> MessageFormat.UNKNOWN
RustMessageFormat.Html -> MessageFormat.HTML
is RustMessageFormat.Unknown -> MessageFormat.UNKNOWN
}
}