Factorize code and remove unused field in TimelineItemPollContent

This commit is contained in:
Florian Renaud 2023-08-29 15:58:46 +02:00
parent c710cb7432
commit 65ee52bb27
4 changed files with 145 additions and 158 deletions

View file

@ -69,7 +69,6 @@ class TimelineItemContentPollFactory @Inject constructor(
return TimelineItemPollContent(
question = content.question,
answerItems = answerItems,
votes = content.votes,
pollKind = content.kind,
isEnded = isEndedPoll,
)

View file

@ -17,13 +17,11 @@
package io.element.android.features.messages.impl.timeline.model.event
import io.element.android.features.poll.api.PollAnswerItem
import io.element.android.libraries.matrix.api.core.UserId
import io.element.android.libraries.matrix.api.poll.PollKind
data class TimelineItemPollContent(
val question: String,
val answerItems: List<PollAnswerItem>,
val votes: Map<String, List<UserId>>,
val pollKind: PollKind,
val isEnded: Boolean,
) : TimelineItemEventContent {

View file

@ -34,6 +34,5 @@ fun aTimelineItemPollContent(): TimelineItemPollContent {
question = "What type of food should we have at the party?",
answerItems = aPollAnswerItemList(),
isEnded = false,
votes = emptyMap(),
)
}