Pinned events : introduce pinnedEventsTimeline method.

This commit is contained in:
ganfra 2024-08-01 18:22:22 +02:00
parent 039744c4be
commit 34fd21f440
3 changed files with 25 additions and 0 deletions

View file

@ -192,6 +192,21 @@ class RustMatrixRoom(
}
}
override suspend fun pinnedEventsTimeline(): Result<Timeline> {
return runCatching {
innerRoom.pinnedEventsTimeline(
internalIdPrefix = "pinned_events",
maxEventsToLoad = 100u,
).let { inner ->
createTimeline(inner, isLive = false)
}
}.onFailure {
if (it is CancellationException) {
throw it
}
}
}
override fun destroy() {
roomCoroutineScope.cancel()
liveTimeline.close()