mirror of
https://github.com/element-hq/element-android
synced 2024-11-23 01:45:36 +03:00
Adding fallback text on Poll end message
This commit is contained in:
parent
cf609e5fe3
commit
28089618a3
2 changed files with 10 additions and 3 deletions
|
@ -33,5 +33,11 @@ data class MessageEndPollContent(
|
|||
override val msgType: String = MessageType.MSGTYPE_POLL_END,
|
||||
@Json(name = "body") override val body: String = "",
|
||||
@Json(name = "m.new_content") override val newContent: Content? = null,
|
||||
@Json(name = "m.relates_to") override val relatesTo: RelationDefaultContent? = null
|
||||
) : MessageContent
|
||||
@Json(name = "m.relates_to") override val relatesTo: RelationDefaultContent? = null,
|
||||
@Json(name = "org.matrix.msc1767.text") val unstableText: String? = null,
|
||||
@Json(name = "m.text") val text: String? = null,
|
||||
) : MessageContent {
|
||||
fun getBestText() = text ?: unstableText
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -242,7 +242,8 @@ internal class LocalEchoEventFactory @Inject constructor(
|
|||
relatesTo = RelationDefaultContent(
|
||||
type = RelationType.REFERENCE,
|
||||
eventId = eventId
|
||||
)
|
||||
),
|
||||
unstableText = "Ended poll",
|
||||
)
|
||||
val localId = LocalEcho.createLocalEchoId()
|
||||
return Event(
|
||||
|
|
Loading…
Reference in a new issue