mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
Rust sdk update: make the project compiling
This commit is contained in:
+1
@@ -20,6 +20,7 @@ import io.element.android.libraries.matrix.api.core.EventId
|
|||||||
|
|
||||||
sealed interface EventSendState {
|
sealed interface EventSendState {
|
||||||
object NotSentYet : EventSendState
|
object NotSentYet : EventSendState
|
||||||
|
object Canceled : EventSendState
|
||||||
|
|
||||||
data class SendingFailed(
|
data class SendingFailed(
|
||||||
val error: String
|
val error: String
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ class RustNotificationService(
|
|||||||
eventId: EventId
|
eventId: EventId
|
||||||
): Result<NotificationData?> {
|
): Result<NotificationData?> {
|
||||||
return runCatching {
|
return runCatching {
|
||||||
client.getNotificationItem(roomId.value, eventId.value).use(notificationMapper::map)
|
client.getNotificationItem(roomId.value, eventId.value)?.use(notificationMapper::map)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -70,6 +70,7 @@ fun RustEventSendState?.map(): EventSendState? {
|
|||||||
RustEventSendState.NotSentYet -> EventSendState.NotSentYet
|
RustEventSendState.NotSentYet -> EventSendState.NotSentYet
|
||||||
is RustEventSendState.SendingFailed -> EventSendState.SendingFailed(error)
|
is RustEventSendState.SendingFailed -> EventSendState.SendingFailed(error)
|
||||||
is RustEventSendState.Sent -> EventSendState.Sent(EventId(eventId))
|
is RustEventSendState.Sent -> EventSendState.Sent(EventId(eventId))
|
||||||
|
RustEventSendState.Cancelled -> EventSendState.Canceled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user