element-hq/element-x-ios/issues/2876 - Add support for showing call notifications in the timeline

This commit is contained in:
Stefan Ceriu
2024-05-28 17:20:40 +03:00
committed by Stefan Ceriu
parent a4c9135b58
commit 97e57e6666
13 changed files with 149 additions and 5 deletions
@@ -75,6 +75,8 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
return buildPollTimelineItem(question, kind, maxSelections, answers, votes, endTime, eventItemProxy, isOutgoing, edited)
case .callInvite:
return buildCallInviteTimelineItem(for: eventItemProxy)
case .callNotify:
return buildCallNotificationTimelineItem(for: eventItemProxy)
}
}
@@ -438,6 +440,14 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
sender: eventItemProxy.sender)
}
private func buildCallNotificationTimelineItem(for eventItemProxy: EventTimelineItemProxy) -> RoomTimelineItemProtocol {
CallNotificationRoomTimelineItem(id: eventItemProxy.id,
timestamp: eventItemProxy.timestamp.formatted(date: .omitted, time: .shortened),
isEditable: eventItemProxy.isEditable,
canBeRepliedTo: eventItemProxy.canBeRepliedTo,
sender: eventItemProxy.sender)
}
private func aggregateReactions(_ reactions: [Reaction]) -> [AggregatedReaction] {
reactions.map { reaction in
let senders = reaction.senders