mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Fix skipping subsequent call links.
This commit is contained in:
committed by
Cody Henthorne
parent
23669c3c37
commit
8e92ddbd53
@@ -98,7 +98,8 @@ class CallEventCache(
|
||||
val child = next()
|
||||
|
||||
if (child.type == Type.AD_HOC_CALL.code) {
|
||||
continue
|
||||
previous()
|
||||
break
|
||||
}
|
||||
|
||||
if (parent.peer == child.peer && parent.direction == child.direction && isEventMatch(parent, child) && isWithinTimeout(parent, child)) {
|
||||
|
||||
@@ -172,6 +172,26 @@ class CallEventCacheTest {
|
||||
assertThat(result).size().isEqualTo(3)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Given two call link entries in a row, when I clusterCallEvents, then I expect two entries`() {
|
||||
val testData = listOf(
|
||||
createCacheRecord(
|
||||
callId = 1,
|
||||
peer = 1,
|
||||
type = Type.AD_HOC_CALL.code
|
||||
),
|
||||
createCacheRecord(
|
||||
callId = 2,
|
||||
peer = 2,
|
||||
type = Type.AD_HOC_CALL.code
|
||||
)
|
||||
)
|
||||
|
||||
val filterState = CallEventCache.FilterState()
|
||||
val result = CallEventCache.clusterCallEvents(testData, filterState)
|
||||
assertThat(result).size().isEqualTo(2)
|
||||
}
|
||||
|
||||
private fun createCacheRecord(
|
||||
callId: Long,
|
||||
peer: Long = 1,
|
||||
|
||||
Reference in New Issue
Block a user