Skip to content

Commit

Permalink
Merge pull request #8471 from vector-im/bugfix/cjs/poll-finish-contents
Browse files Browse the repository at this point in the history
Show correct details when a poll is ended.
  • Loading branch information
bmarty committed Jun 9, 2023
2 parents 7d084f1 + 37429c2 commit 48df113
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/8471.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The correct title and options are now displayed When a poll that was edited is ended.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ class MessageItemFactory @Inject constructor(
} else {
null
}
val pollContent = pollStartEvent?.root?.getClearContent()?.toModel<MessagePollContent>()

val editedContent = pollStartEvent?.annotations?.editSummary?.latestEdit?.getClearContent()?.toModel<MessagePollContent>()?.newContent
val latestContent = editedContent ?: pollStartEvent?.root?.getClearContent()
val pollContent = latestContent?.toModel<MessagePollContent>()

return if (pollContent == null) {
val title = stringProvider.getString(R.string.message_reply_to_ended_poll_preview).toEpoxyCharSequence()
Expand Down

0 comments on commit 48df113

Please sign in to comment.