Merge pull request #7051 from element-hq/feature/valere/timeline_active_call_rendering

feat(call): Active call timeline rendering
This commit is contained in:
ganfra
2026-07-24 13:43:43 +02:00
committed by GitHub
41 changed files with 549 additions and 72 deletions
@@ -79,5 +79,6 @@ enum class AvatarSize(val dp: Dp) {
LeaveSpaceRoom(32.dp),
SelectParentSpace(32.dp),
AccountItem(32.dp),
LocationPin(32.dp)
LocationPin(32.dp),
ActiveCallItem(20.dp)
}
@@ -43,8 +43,11 @@ class RtcNotificationContentFormatterTest : RobolectricTest() {
fun `Should not display declined info in rooms`() {
val result = formatter.format(
CallNotifyContent(
CallIntent.VIDEO,
declinedBy = listOf(A_USER_ID_2, A_USER_ID_3)
callIntent = CallIntent.VIDEO,
declinedBy = listOf(A_USER_ID_2, A_USER_ID_3),
activeMembers = emptyList(),
isJoined = false,
callStartTsMillis = 0
),
false
)
@@ -58,7 +61,10 @@ class RtcNotificationContentFormatterTest : RobolectricTest() {
val result = formatter.format(
CallNotifyContent(
CallIntent.VIDEO,
declinedBy = listOf(fakeMatrixClient.sessionId)
declinedBy = listOf(fakeMatrixClient.sessionId),
activeMembers = listOf(A_USER_ID_2),
isJoined = false,
callStartTsMillis = 0
),
true
)
@@ -72,7 +78,10 @@ class RtcNotificationContentFormatterTest : RobolectricTest() {
val result = formatter.format(
CallNotifyContent(
CallIntent.VIDEO,
declinedBy = listOf(A_USER_ID_2)
declinedBy = listOf(A_USER_ID_2),
activeMembers = listOf(fakeMatrixClient.sessionId),
isJoined = true,
callStartTsMillis = 0
),
true
)
@@ -86,7 +95,10 @@ class RtcNotificationContentFormatterTest : RobolectricTest() {
val result = formatter.format(
CallNotifyContent(
CallIntent.AUDIO,
declinedBy = listOf()
declinedBy = listOf(),
activeMembers = emptyList(),
isJoined = false,
callStartTsMillis = 0
),
true
)
@@ -120,7 +120,10 @@ data object LegacyCallInviteContent : EventContent
data class CallNotifyContent(
val callIntent: CallIntent,
val declinedBy: List<UserId>
val declinedBy: List<UserId>,
val activeMembers: List<UserId>,
val isJoined: Boolean,
val callStartTsMillis: Long?,
) : EventContent
data object UnknownContent : EventContent
@@ -154,7 +154,10 @@ class TimelineEventContentMapper(
} else {
CallIntent.VIDEO
},
declinedBy = it.declinedBy.map(::UserId)
declinedBy = it.declinedBy.map(::UserId),
activeMembers = it.activeMembers.map(::UserId),
callStartTsMillis = it.callStartTsMillis?.toLong(),
isJoined = it.isJoined
)
}
}
@@ -68,7 +68,13 @@ class EventItemFactoryTest {
fun `create check all null cases`() {
val factory = createEventItemFactory()
val contents = listOf(
CallNotifyContent(callIntent = CallIntent.VIDEO, emptyList()),
CallNotifyContent(
callIntent = CallIntent.VIDEO,
declinedBy = emptyList(),
activeMembers = emptyList(),
isJoined = false,
callStartTsMillis = null,
),
FailedToParseMessageLikeContent("", ""),
FailedToParseStateContent("", "", ""),
LegacyCallInviteContent,