mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Merge pull request #7051 from element-hq/feature/valere/timeline_active_call_rendering
feat(call): Active call timeline rendering
This commit is contained in:
+2
-1
@@ -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)
|
||||
}
|
||||
|
||||
+17
-5
@@ -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
|
||||
)
|
||||
|
||||
+4
-1
@@ -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
|
||||
|
||||
+4
-1
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+7
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user