Skip to content

Commit 48df113

Browse files
authored
Merge pull request #8471 from vector-im/bugfix/cjs/poll-finish-contents
Show correct details when a poll is ended.
2 parents 7d084f1 + 37429c2 commit 48df113

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

changelog.d/8471.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The correct title and options are now displayed When a poll that was edited is ended.

vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ class MessageItemFactory @Inject constructor(
286286
} else {
287287
null
288288
}
289-
val pollContent = pollStartEvent?.root?.getClearContent()?.toModel<MessagePollContent>()
289+
290+
val editedContent = pollStartEvent?.annotations?.editSummary?.latestEdit?.getClearContent()?.toModel<MessagePollContent>()?.newContent
291+
val latestContent = editedContent ?: pollStartEvent?.root?.getClearContent()
292+
val pollContent = latestContent?.toModel<MessagePollContent>()
290293

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

0 commit comments

Comments
 (0)