Refactor theTimelineItemIdentifier handling; stop relying on optional EventOrTransactionIds and be explicit when setting composer modes from the draft service.

This commit is contained in:
Stefan Ceriu
2024-10-16 14:07:54 +03:00
parent 2f10a74836
commit 2c31885355
56 changed files with 313 additions and 298 deletions

View File

@@ -116,7 +116,7 @@ class LoggingTests: XCTestCase {
func validateTimelineContentIsRedacted() throws {
// Given timeline items that contain text
let textAttributedString = "TextAttributed"
let textMessage = TextRoomTimelineItem(id: .random,
let textMessage = TextRoomTimelineItem(id: .randomEvent,
timestamp: "",
isOutgoing: false,
isEditable: false,
@@ -125,7 +125,7 @@ class LoggingTests: XCTestCase {
sender: .init(id: "sender"),
content: .init(body: "TextString", formattedBody: AttributedString(textAttributedString)))
let noticeAttributedString = "NoticeAttributed"
let noticeMessage = NoticeRoomTimelineItem(id: .random,
let noticeMessage = NoticeRoomTimelineItem(id: .randomEvent,
timestamp: "",
isOutgoing: false,
isEditable: false,
@@ -134,7 +134,7 @@ class LoggingTests: XCTestCase {
sender: .init(id: "sender"),
content: .init(body: "NoticeString", formattedBody: AttributedString(noticeAttributedString)))
let emoteAttributedString = "EmoteAttributed"
let emoteMessage = EmoteRoomTimelineItem(id: .random,
let emoteMessage = EmoteRoomTimelineItem(id: .randomEvent,
timestamp: "",
isOutgoing: false,
isEditable: false,
@@ -142,7 +142,7 @@ class LoggingTests: XCTestCase {
isThreaded: false,
sender: .init(id: "sender"),
content: .init(body: "EmoteString", formattedBody: AttributedString(emoteAttributedString)))
let imageMessage = ImageRoomTimelineItem(id: .init(uniqueID: "myimagemessage"),
let imageMessage = ImageRoomTimelineItem(id: .randomEvent,
timestamp: "",
isOutgoing: false,
isEditable: false,
@@ -153,7 +153,7 @@ class LoggingTests: XCTestCase {
caption: "ImageString",
source: MediaSourceProxy(url: .picturesDirectory, mimeType: "image/gif"),
thumbnailSource: nil))
let videoMessage = VideoRoomTimelineItem(id: .random,
let videoMessage = VideoRoomTimelineItem(id: .randomEvent,
timestamp: "",
isOutgoing: false,
isEditable: false,
@@ -165,7 +165,7 @@ class LoggingTests: XCTestCase {
duration: 0,
source: nil,
thumbnailSource: nil))
let fileMessage = FileRoomTimelineItem(id: .random,
let fileMessage = FileRoomTimelineItem(id: .randomEvent,
timestamp: "",
isOutgoing: false,
isEditable: false,