diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt index e672cf9394..d8bc7bf579 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt @@ -191,8 +191,8 @@ class RustMatrixRoom( override suspend fun subscribeToSync() = roomSyncSubscriber.subscribe(roomId) - override suspend fun timelineFocusedOnEvent(eventId: EventId): Result { - return runCatching { + override suspend fun timelineFocusedOnEvent(eventId: EventId): Result = withContext(roomDispatcher) { + runCatching { innerRoom.timelineFocusedOnEvent( eventId = eventId.value, numContextEvents = 50u, @@ -209,8 +209,8 @@ class RustMatrixRoom( } } - override suspend fun pinnedEventsTimeline(): Result { - return runCatching { + override suspend fun pinnedEventsTimeline(): Result = withContext(roomDispatcher) { + runCatching { innerRoom.pinnedEventsTimeline( internalIdPrefix = "pinned_events", maxEventsToLoad = 100u, @@ -225,8 +225,8 @@ class RustMatrixRoom( } } - override suspend fun mediaTimeline(): Result { - return runCatching { + override suspend fun mediaTimeline(): Result = withContext(roomDispatcher) { + runCatching { innerRoom.messageFilteredTimeline( internalIdPrefix = "MediaGallery_", allowedMessageTypes = listOf(