Add timeline properties for edited and reactions.

Not yet visible, waiting for timeline API.
This commit is contained in:
Doug
2022-09-14 10:43:58 +01:00
committed by Doug
parent 2986f85bcb
commit 7dd77be01b
26 changed files with 329 additions and 37 deletions
@@ -28,4 +28,6 @@ struct EmoteRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Equa
let senderId: String
var senderDisplayName: String?
var senderAvatar: UIImage?
let properties: RoomTimelineItemProperties
}
@@ -35,4 +35,6 @@ struct ImageRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Equa
var height: CGFloat?
var aspectRatio: CGFloat?
var blurhash: String?
let properties: RoomTimelineItemProperties
}
@@ -28,4 +28,6 @@ struct NoticeRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Equ
let senderId: String
var senderDisplayName: String?
var senderAvatar: UIImage?
let properties: RoomTimelineItemProperties
}
@@ -0,0 +1,25 @@
//
// Copyright 2022 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import Foundation
/// Properties of a matrix event that are common between all timeline items.
struct RoomTimelineItemProperties: Equatable {
/// Whether the item has been edited.
var isEdited = false
/// The aggregated reactions that have been sent for this item.
var reactions: [AggregatedReaction] = []
}
@@ -28,4 +28,6 @@ struct TextRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Equat
let senderId: String
var senderDisplayName: String?
var senderAvatar: UIImage?
let properties: RoomTimelineItemProperties
}