Merge pull request #1298 from vector-im/feature/fga/timeline_thread_decoration

Feature/fga/timeline thread decoration
This commit is contained in:
ganfra 2023-09-14 18:45:33 +02:00 committed by GitHub
commit 54b290d630
32 changed files with 178 additions and 69 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

View file

@ -68,6 +68,7 @@ class EventMessageMapper {
body = it.body(),
inReplyTo = inReplyToEvent,
isEdited = it.isEdited(),
isThreaded = it.isThreaded(),
type = type
)
}

View file

@ -147,6 +147,7 @@ fun aMessageContent(
body: String = "body",
inReplyTo: InReplyTo? = null,
isEdited: Boolean = false,
isThreaded: Boolean = false,
messageType: MessageType = TextMessageType(
body = body,
formatted = null
@ -155,6 +156,7 @@ fun aMessageContent(
body = body,
inReplyTo = inReplyTo,
isEdited = isEdited,
isThreaded = isThreaded,
type = messageType
)