aboutsummaryrefslogtreecommitdiff
path: root/Hotline/Models/Hotline.swift
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-10-25 15:26:05 -0700
committerDustin Mierau <dustin@mierau.me>2025-10-25 15:26:05 -0700
commit53686e30592fee566585e391738adee8b2ef2137 (patch)
tree7ee768ca3c84ac7dad7ea674fb637480e4b7184c /Hotline/Models/Hotline.swift
parent65521893ac5f10ec035cd735747034c263e46d77 (diff)
Fixed some warnings. Add basic markdown formatting support to chat messages. Add some metadata support for chat log (though we're not using this yet).
Diffstat (limited to 'Hotline/Models/Hotline.swift')
-rw-r--r--Hotline/Models/Hotline.swift8
1 files changed, 5 insertions, 3 deletions
diff --git a/Hotline/Models/Hotline.swift b/Hotline/Models/Hotline.swift
index 08b79a1..3783ba0 100644
--- a/Hotline/Models/Hotline.swift
+++ b/Hotline/Models/Hotline.swift
@@ -1445,7 +1445,9 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileDownloadClientDelega
else {
renderedText = entry.body
}
- return ChatMessage(text: renderedText, type: chatType, date: entry.date)
+ var message = ChatMessage(text: renderedText, type: chatType, date: entry.date)
+ message.metadata = entry.metadata
+ return message
}
self.chat = historyMessages + currentMessages
self.lastPersistedMessageType = historyMessages.last?.type
@@ -1530,12 +1532,12 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileDownloadClientDelega
guard let parent = self.findNews(in: self.news, at: path), !parent.children.isEmpty else {
return nil
}
-
+
return parent.children.first { child in
guard let childArticleID = child.articleID else {
return false
}
-
+
return child.type == .article && child.articleID == childArticleID
}
}