Fixes #1837 - Add support for m.call.invite events in the timeline, room list and notifications

This commit is contained in:
Stefan Ceriu
2024-03-02 19:12:02 +02:00
committed by Stefan Ceriu
parent 82a5d34dd7
commit 063b3732b1
12 changed files with 116 additions and 3 deletions
@@ -74,7 +74,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
case .poll(question: let question, kind: let kind, maxSelections: let maxSelections, answers: let answers, votes: let votes, endTime: let endTime, let edited):
return buildPollTimelineItem(question, kind, maxSelections, answers, votes, endTime, eventItemProxy, isOutgoing, edited)
case .callInvite:
return nil
return buildCallInviteTimelineItem(for: eventItemProxy)
}
}
@@ -422,6 +422,14 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
orderedReadReceipts: orderReadReceipts(eventItemProxy.readReceipts)))
}
private func buildCallInviteTimelineItem(for eventItemProxy: EventTimelineItemProxy) -> RoomTimelineItemProtocol {
CallInviteRoomTimelineItem(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