Pinned events : start displaying actions in timeline

This commit is contained in:
ganfra 2024-08-28 21:59:10 +02:00
parent 3bcd76d271
commit 3cc749dd0a
24 changed files with 474 additions and 86 deletions

View file

@ -17,14 +17,16 @@
package io.element.android.libraries.matrix.api.timeline
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.first
/**
* This interface defines a way to get the active timeline.
* It could be the current room timeline, or a timeline for a specific event.
* It could be the live timeline, a pinned timeline or a detached timeline.
* By default, the active timeline is the live timeline.
*/
interface TimelineProvider {
fun activeTimelineFlow(): StateFlow<Timeline>
fun activeTimelineFlow(): StateFlow<Timeline?>
}
suspend fun TimelineProvider.getActiveTimeline(): Timeline = activeTimelineFlow().first()
suspend fun TimelineProvider.getActiveTimeline(): Timeline = activeTimelineFlow().filterNotNull().first()