mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
convert "votes" map
see https://github.com/nextcloud/spreed/pull/7500 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
73d48a395c
commit
01f7016ae2
@ -123,7 +123,7 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
|
||||
pollResponse.id,
|
||||
pollResponse.question,
|
||||
pollResponse.options,
|
||||
pollResponse.votes,
|
||||
convertVotes(pollResponse.votes),
|
||||
pollResponse.actorType,
|
||||
pollResponse.actorId,
|
||||
pollResponse.actorDisplayName,
|
||||
@ -137,6 +137,14 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
|
||||
return poll
|
||||
}
|
||||
|
||||
private fun convertVotes(votes: Map<String, Int>?): Map<String, Int> {
|
||||
val resultMap: MutableMap<String, Int> = HashMap()
|
||||
votes?.forEach {
|
||||
resultMap[it.key.replace("option-", "")] = it.value
|
||||
}
|
||||
return resultMap
|
||||
}
|
||||
|
||||
private fun mapToPollDetails(pollDetailsResponse: PollDetailsResponse): PollDetails {
|
||||
return PollDetails(
|
||||
pollDetailsResponse.actorType,
|
||||
|
Loading…
Reference in New Issue
Block a user