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 646ab8290a..609b6481c2 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 @@ -204,8 +204,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, @@ -222,8 +222,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, @@ -238,8 +238,8 @@ class RustMatrixRoom( } } - override suspend fun mediaTimeline(): Result { - return runCatching { + override suspend fun mediaTimeline(): Result = withContext(roomDispatcher) { + runCatching { innerRoom.messageFilteredTimeline( internalIdPrefix = "MediaGallery_", allowedMessageTypes = listOf(