mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
CallTileTimelineItem.CallStatus.MISSED renders both missed and rejected calls. Logic should be !answered.
This commit is contained in:
parent
ff6810f1f4
commit
e9ae76da9c
3 changed files with 4 additions and 6 deletions
1
changelog.d/5088.bugfix
Normal file
1
changelog.d/5088.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fixes call statuses in the timeline for missed/rejected calls and connected calls.
|
|
@ -101,7 +101,7 @@ class CallItemFactory @Inject constructor(
|
|||
createCallTileTimelineItem(
|
||||
roomSummary = roomSummary,
|
||||
callId = callEventGrouper.callId,
|
||||
callStatus = if (callEventGrouper.callWasMissed()) CallTileTimelineItem.CallStatus.MISSED else CallTileTimelineItem.CallStatus.ENDED,
|
||||
callStatus = if (!callEventGrouper.callWasAnswered()) CallTileTimelineItem.CallStatus.MISSED else CallTileTimelineItem.CallStatus.ENDED,
|
||||
callKind = callKind,
|
||||
callback = params.callback,
|
||||
highlight = params.isHighlighted,
|
||||
|
|
|
@ -108,11 +108,8 @@ class CallSignalingEventsGroup(private val group: TimelineEventsGroup) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if there are only events from one side.
|
||||
*/
|
||||
fun callWasMissed(): Boolean {
|
||||
return group.events.distinctBy { it.senderInfo.userId }.size == 1
|
||||
fun callWasAnswered(): Boolean {
|
||||
return getAnswer() != null
|
||||
}
|
||||
|
||||
private fun getAnswer(): TimelineEvent? {
|
||||
|
|
Loading…
Reference in a new issue