Timeline: first version of diff/cache
This commit is contained in:
parent
2d54838e4f
commit
dd0e3c535b
6 changed files with 157 additions and 28 deletions
|
|
@ -2,9 +2,17 @@ package io.element.android.x.matrix.timeline
|
|||
|
||||
import org.matrix.rustcomponents.sdk.EventTimelineItem
|
||||
import org.matrix.rustcomponents.sdk.TimelineItem
|
||||
import org.matrix.rustcomponents.sdk.TimelineKey
|
||||
|
||||
sealed interface MatrixTimelineItem {
|
||||
data class Event(val event: EventTimelineItem) : MatrixTimelineItem
|
||||
data class Event(val event: EventTimelineItem) : MatrixTimelineItem {
|
||||
val uniqueId: String
|
||||
get() = when (val eventKey = event.key()) {
|
||||
is TimelineKey.TransactionId -> eventKey.txnId
|
||||
is TimelineKey.EventId -> eventKey.eventId
|
||||
}
|
||||
}
|
||||
|
||||
object Virtual : MatrixTimelineItem
|
||||
object Other : MatrixTimelineItem
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue