mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Add support for active call item rendering in timeline (#5775)
* feat(timeline): Add support for active call item rendering in timeline * Update active call as per design (show raw count of members) * fixup project files * revert unexpected generated mocks change * code review * Record preview snapshots * revert changes on project.yml * post rebase fix
This commit is contained in:
@@ -71,8 +71,14 @@ nonisolated struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
isOutgoing: isOutgoing)
|
||||
case .callInvite:
|
||||
return buildCallInviteTimelineItem(for: eventItemProxy)
|
||||
case .rtcNotification(let callIntent, let declinedBy, _, _, _):
|
||||
return buildCallNotificationTimelineItem(for: eventItemProxy, isDM: isDM, callIntent: callIntent, declinedBy: declinedBy)
|
||||
case .rtcNotification(let callIntent, let declinedBy, let activeMembers, let callStartMillis, let isJoined):
|
||||
return buildCallNotificationTimelineItem(for: eventItemProxy,
|
||||
isDM: isDM,
|
||||
callIntent: callIntent,
|
||||
declinedBy: declinedBy,
|
||||
activeMembers: activeMembers,
|
||||
callStartTimestampMillis: callStartMillis,
|
||||
isJoined: isJoined)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -853,15 +859,25 @@ nonisolated struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
private func buildCallNotificationTimelineItem(for eventItemProxy: EventTimelineItemProxy,
|
||||
isDM: Bool,
|
||||
callIntent: String?,
|
||||
declinedBy: [String]) -> RoomTimelineItemProtocol {
|
||||
declinedBy: [String],
|
||||
activeMembers: [String],
|
||||
callStartTimestampMillis: UInt64?,
|
||||
isJoined: Bool) -> RoomTimelineItemProtocol {
|
||||
let isVoiceCall = callIntent == CallIntent.audio.rawValue
|
||||
let callStartTimestamp = callStartTimestampMillis.map { Date(timeIntervalSince1970: TimeInterval($0 / 1000)) }
|
||||
|
||||
return CallNotificationRoomTimelineItem(id: eventItemProxy.id,
|
||||
timestamp: eventItemProxy.timestamp,
|
||||
sender: eventItemProxy.sender,
|
||||
isDM: isDM,
|
||||
isDeclinedByMe: declinedBy.contains(userID),
|
||||
isDeclined: !declinedBy.isEmpty,
|
||||
isVoiceCall: isVoiceCall,
|
||||
properties: .init())
|
||||
callState: activeMembers.count > 0 ?
|
||||
.active(activeMembers: activeMembers,
|
||||
isJoined: isJoined,
|
||||
callStartTimestamp: callStartTimestamp)
|
||||
:
|
||||
.tombstoned(isDeclinedByMe: declinedBy.contains(userID),
|
||||
isDeclined: declinedBy.count > 0))
|
||||
}
|
||||
|
||||
// MARK: - State Events
|
||||
|
||||
Reference in New Issue
Block a user