use the appropriate timeline kind (to be refactored)

This commit is contained in:
Mauro Romito
2026-07-29 14:24:51 +02:00
committed by Mauro
parent d8cb49e892
commit 68a277143a
13 changed files with 107 additions and 27 deletions
@@ -165,7 +165,15 @@ enum TimelineFixtures {
VideoRoomTimelineItem(isOutgoing: false, caption: "Woah, it was incredible!"),
VideoRoomTimelineItem(isOutgoing: true),
VoiceMessageRoomTimelineItem(isOutgoing: false),
VoiceMessageRoomTimelineItem(isOutgoing: true)
VoiceMessageRoomTimelineItem(isOutgoing: true),
GalleryRoomTimelineItem(isOutgoing: false,
items: [.mockImage(index: 0), .mockVideo(index: 1), .mockImage(index: 2)]),
GalleryRoomTimelineItem(isOutgoing: true,
items: [.mockImage(index: 0),
.mockVideo(index: 1),
.mockFile(index: 2, source: try? .init(url: .mockMXCFile, mimeType: nil)),
.mockAudio(index: 3, source: try? .init(url: .mockMXCAudio, mimeType: nil))],
caption: "Everything from the trip!")
]
}
@@ -358,6 +366,18 @@ private extension FileRoomTimelineItem {
}
}
private extension GalleryRoomTimelineItem {
init(isOutgoing: Bool, items: [GalleryItem], caption: String? = nil) {
self.init(id: .randomEvent,
timestamp: .mock,
isOutgoing: isOutgoing,
isEditable: isOutgoing,
canBeRepliedTo: true,
sender: .init(id: isOutgoing ? "@alice:matrix.org" : "@bob:matrix.org"),
content: .init(body: "Gallery", caption: caption, items: items))
}
}
private extension ImageRoomTimelineItem {
init(isOutgoing: Bool, caption: String? = nil) {
self.init(id: .randomEvent,