mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-28 16:59:01 +03:00
Code review fix.
This commit is contained in:
parent
ec27c67940
commit
8495536fd3
1 changed files with 14 additions and 10 deletions
|
@ -50,18 +50,22 @@ class PollResponseDataFactory @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getPollResponseSummary(event: TimelineEvent): PollResponseAggregatedSummary? {
|
private fun getPollResponseSummary(event: TimelineEvent): PollResponseAggregatedSummary? {
|
||||||
if (event.root.isPollEnd()) {
|
return if (event.root.isPollEnd()) {
|
||||||
val pollStartEventId = event.root.getRelationContent()?.eventId ?: return null.also {
|
val pollStartEventId = event.root.getRelationContent()?.eventId
|
||||||
|
if (pollStartEventId.isNullOrEmpty()) {
|
||||||
Timber.e("### Cannot render poll end event because poll start event id is null")
|
Timber.e("### Cannot render poll end event because poll start event id is null")
|
||||||
|
null
|
||||||
|
} else {
|
||||||
|
activeSessionHolder
|
||||||
|
.getSafeActiveSession()
|
||||||
|
?.roomService()
|
||||||
|
?.getRoom(event.roomId)
|
||||||
|
?.getTimelineEvent(pollStartEventId)
|
||||||
|
?.annotations
|
||||||
|
?.pollResponseSummary
|
||||||
}
|
}
|
||||||
return activeSessionHolder
|
} else {
|
||||||
.getSafeActiveSession()
|
event.annotations?.pollResponseSummary
|
||||||
?.roomService()
|
|
||||||
?.getRoom(event.roomId)
|
|
||||||
?.getTimelineEvent(pollStartEventId)
|
|
||||||
?.annotations
|
|
||||||
?.pollResponseSummary
|
|
||||||
}
|
}
|
||||||
return event.annotations?.pollResponseSummary
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue