mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-09 00:29:00 +01:00
CallTileTimelineItem.CallStatus.MISSED renders both missed and rejected calls. Logic should be !answered.
This commit is contained in:
parent
ff6810f1f4
commit
e9ae76da9c
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(
|
createCallTileTimelineItem(
|
||||||
roomSummary = roomSummary,
|
roomSummary = roomSummary,
|
||||||
callId = callEventGrouper.callId,
|
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,
|
callKind = callKind,
|
||||||
callback = params.callback,
|
callback = params.callback,
|
||||||
highlight = params.isHighlighted,
|
highlight = params.isHighlighted,
|
||||||
|
@ -108,11 +108,8 @@ class CallSignalingEventsGroup(private val group: TimelineEventsGroup) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
fun callWasAnswered(): Boolean {
|
||||||
* Returns true if there are only events from one side.
|
return getAnswer() != null
|
||||||
*/
|
|
||||||
fun callWasMissed(): Boolean {
|
|
||||||
return group.events.distinctBy { it.senderInfo.userId }.size == 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getAnswer(): TimelineEvent? {
|
private fun getAnswer(): TimelineEvent? {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user