Thread decoration: add and branch isThreaded method

This commit is contained in:
ganfra 2023-09-13 12:05:50 +02:00
parent 30436e4406
commit 36fdf243cc
10 changed files with 23 additions and 5 deletions

View file

@ -32,6 +32,7 @@ data class MessageContent(
val body: String,
val inReplyTo: InReplyTo?,
val isEdited: Boolean,
val isThreaded: Boolean,
val type: MessageType?
) : EventContent

View file

@ -40,6 +40,11 @@ data class EventTimelineItem(
fun inReplyTo(): InReplyTo? {
return (content as? MessageContent)?.inReplyTo
}
fun isThreaded(): Boolean {
return (content as? MessageContent)?.isThreaded ?: false
}
fun hasNotLoadedInReplyTo(): Boolean {
val details = inReplyTo()
return details is InReplyTo.NotLoaded