0011 0012 patch fixes
iOS CI / Build and Test SwiftUI App (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build Unsigned iOS IPA (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build macOS ZIP (push) Canceled after 0s

This commit is contained in:
wt committed 2026-08-11 22:49:52 +07:00
1 parent 65605ded95
commit 57eaf56023
3 files changed
+128 -16

No files matched your search

+23 -6
View File
@@ -96,6 +96,7 @@ final class AppModel: ObservableObject {
private var lastSuccessfulMAMSync: Date?
private var lastSuccessfulMAMCursor: String?
private var mamCheckpoints: [MAMArchiveKey: MAMArchiveCheckpoint] = [:]
private var hasMoreOlderHistoryByConversation: [String: Bool] = [:]
private var pendingRoomPasswords: [String: String] = [:]
private var joiningRoomJIDs: Set<String> = []
private var mediaSendActivity = MediaSendActivityTracker()
@@ -510,22 +511,31 @@ final class AppModel: ObservableObject {
// }
// schedulePersist()
// syncWatch()
hasMoreOlderHistory = true
// hasMoreOlderHistory = true
hasMoreOlderHistory = hasMoreOlderHistoryByConversation[normalized] ?? true
}
func loadOlderHistoryForSelectedConversation() {
guard !isLoadingOlderHistory,
hasMoreOlderHistory,
let conversation = selectedConversation else { return }
// let oldestServerID = selectedMessages
// .sorted { lhs, rhs in
// if lhs.timestamp != rhs.timestamp { return lhs.timestamp < rhs.timestamp }
// return lhs.id < rhs.id
// }
// .compactMap(\.stanzaID)
// .first
let oldestServerID = selectedMessages
.sorted { lhs, rhs in
.filter { $0.stanzaID != nil }
.min { lhs, rhs in
if lhs.timestamp != rhs.timestamp { return lhs.timestamp < rhs.timestamp }
return lhs.id < rhs.id
}
.compactMap(\.stanzaID)
.first
}?
.stanzaID
isLoadingOlderHistory = true
let conversationID = conversation.id.lowercased()
xmpp.loadOlderHistory(
conversationJID: conversation.jid,
isGroup: conversation.isGroup,
@@ -535,7 +545,11 @@ final class AppModel: ObservableObject {
self.isLoadingOlderHistory = false
switch result {
case .success(let hasMore):
self.hasMoreOlderHistory = hasMore
// self.hasMoreOlderHistory = hasMore
self.hasMoreOlderHistoryByConversation[conversationID] = hasMore
if self.selectedConversationID == conversationID {
self.hasMoreOlderHistory = hasMore
}
case .failure(let error):
self.errorMessage = error.localizedDescription
}
@@ -1926,6 +1940,9 @@ final class AppModel: ObservableObject {
}
private func consumeMessage(_ envelope: XMPPService.MessageEnvelope) {
if !envelope.isGroupMessage {
upsertConversation(jid: envelope.peerJID, name: nil)
}
if let stanzaID = envelope.stanzaID,
messageIndex(referenceID: stanzaID, conversationID: envelope.peerJID) != nil
{