Fix call event not rendered in e2e rooms.
This commit is contained in:
parent
c76eb3bc98
commit
116bab5bc8
@ -60,7 +60,7 @@ class NoticeEventFormatter @Inject constructor(private val sessionHolder: Active
|
|||||||
EventType.STATE_ROOM_TOMBSTONE -> formatRoomTombstoneEvent(timelineEvent.senderInfo.disambiguatedDisplayName)
|
EventType.STATE_ROOM_TOMBSTONE -> formatRoomTombstoneEvent(timelineEvent.senderInfo.disambiguatedDisplayName)
|
||||||
EventType.CALL_INVITE,
|
EventType.CALL_INVITE,
|
||||||
EventType.CALL_HANGUP,
|
EventType.CALL_HANGUP,
|
||||||
EventType.CALL_ANSWER -> formatCallEvent(timelineEvent.root, timelineEvent.senderInfo.disambiguatedDisplayName)
|
EventType.CALL_ANSWER -> formatCallEvent(type, timelineEvent.root, timelineEvent.senderInfo.disambiguatedDisplayName)
|
||||||
EventType.MESSAGE,
|
EventType.MESSAGE,
|
||||||
EventType.REACTION,
|
EventType.REACTION,
|
||||||
EventType.KEY_VERIFICATION_START,
|
EventType.KEY_VERIFICATION_START,
|
||||||
@ -87,7 +87,7 @@ class NoticeEventFormatter @Inject constructor(private val sessionHolder: Active
|
|||||||
EventType.STATE_ROOM_HISTORY_VISIBILITY -> formatRoomHistoryVisibilityEvent(event, senderName)
|
EventType.STATE_ROOM_HISTORY_VISIBILITY -> formatRoomHistoryVisibilityEvent(event, senderName)
|
||||||
EventType.CALL_INVITE,
|
EventType.CALL_INVITE,
|
||||||
EventType.CALL_HANGUP,
|
EventType.CALL_HANGUP,
|
||||||
EventType.CALL_ANSWER -> formatCallEvent(event, senderName)
|
EventType.CALL_ANSWER -> formatCallEvent(type, event, senderName)
|
||||||
EventType.STATE_ROOM_TOMBSTONE -> formatRoomTombstoneEvent(senderName)
|
EventType.STATE_ROOM_TOMBSTONE -> formatRoomTombstoneEvent(senderName)
|
||||||
else -> {
|
else -> {
|
||||||
Timber.v("Type $type not handled by this formatter")
|
Timber.v("Type $type not handled by this formatter")
|
||||||
@ -140,9 +140,9 @@ class NoticeEventFormatter @Inject constructor(private val sessionHolder: Active
|
|||||||
return sp.getString(R.string.notice_made_future_room_visibility, senderName, formattedVisibility)
|
return sp.getString(R.string.notice_made_future_room_visibility, senderName, formattedVisibility)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun formatCallEvent(event: Event, senderName: String?): CharSequence? {
|
private fun formatCallEvent(type: String, event: Event, senderName: String?): CharSequence? {
|
||||||
return when {
|
return when (type) {
|
||||||
EventType.CALL_INVITE == event.type -> {
|
EventType.CALL_INVITE -> {
|
||||||
val content = event.getClearContent().toModel<CallInviteContent>() ?: return null
|
val content = event.getClearContent().toModel<CallInviteContent>() ?: return null
|
||||||
val isVideoCall = content.offer.sdp == CallInviteContent.Offer.SDP_VIDEO
|
val isVideoCall = content.offer.sdp == CallInviteContent.Offer.SDP_VIDEO
|
||||||
return if (isVideoCall) {
|
return if (isVideoCall) {
|
||||||
@ -151,8 +151,8 @@ class NoticeEventFormatter @Inject constructor(private val sessionHolder: Active
|
|||||||
sp.getString(R.string.notice_placed_voice_call, senderName)
|
sp.getString(R.string.notice_placed_voice_call, senderName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EventType.CALL_ANSWER == event.type -> sp.getString(R.string.notice_answered_call, senderName)
|
EventType.CALL_ANSWER -> sp.getString(R.string.notice_answered_call, senderName)
|
||||||
EventType.CALL_HANGUP == event.type -> sp.getString(R.string.notice_ended_call, senderName)
|
EventType.CALL_HANGUP -> sp.getString(R.string.notice_ended_call, senderName)
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user