Support for ongoing voice vs video call + joining (#5399)

This commit is contained in:
Valere Fedronic
2026-04-21 11:11:52 +02:00
committed by GitHub
parent d9013208dd
commit d49a6e5a5d
31 changed files with 185 additions and 54 deletions
@@ -110,6 +110,17 @@ struct RoomInfoProxy: RoomInfoProxyProtocol {
roomInfo.hasRoomCall
}
var activeRoomCallIntent: CallIntent? {
switch roomInfo.activeRoomCallConsensusIntent {
case .full(let intent):
return .init(rustCallIntent: intent)
case .partial(intent: let intent, _, _):
return .init(rustCallIntent: intent)
case .none:
return nil
}
}
var activeRoomCallParticipants: [String] {
roomInfo.activeRoomCallParticipants
}
@@ -51,6 +51,7 @@ protocol RoomInfoProxyProtocol: BaseRoomInfoProxyProtocol {
var notificationCount: Int { get }
var cachedUserDefinedNotificationMode: RoomNotificationMode? { get }
var hasRoomCall: Bool { get }
var activeRoomCallIntent: CallIntent? { get }
var activeRoomCallParticipants: [String] { get }
var isMarkedUnread: Bool { get }
var unreadMessagesCount: UInt { get }
@@ -57,6 +57,7 @@ struct RoomSummary {
let alternativeAliases: Set<String>
let hasOngoingCall: Bool
let activeCallIntent: CallIntent?
let isMarkedUnread: Bool
let isFavourite: Bool
@@ -140,6 +141,7 @@ extension RoomSummary {
canonicalAlias = nil
alternativeAliases = []
hasOngoingCall = false
activeCallIntent = nil
joinRequestType = nil
isMarkedUnread = false
@@ -313,6 +313,15 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
default: nil
}
let activeCallIntent: RtcCallIntent? = switch roomInfo.activeRoomCallConsensusIntent {
case .full(let intent):
intent
case .partial(intent: let intent, _, _):
intent
case .none:
nil
}
return RoomSummary(room: room,
id: roomInfo.id,
joinRequestType: joinRequestType,
@@ -332,6 +341,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
canonicalAlias: roomInfo.canonicalAlias,
alternativeAliases: .init(roomInfo.alternativeAliases),
hasOngoingCall: roomInfo.hasRoomCall,
activeCallIntent: activeCallIntent.map { .init(rustCallIntent: $0) },
isMarkedUnread: roomInfo.isMarkedUnread,
isFavourite: roomInfo.isFavourite,
isTombstoned: roomInfo.successorRoom != nil)