From ac09086eaa87d955f13e73629102202e59f14528 Mon Sep 17 00:00:00 2001 From: fmodf Date: Sun, 18 Aug 2024 17:04:18 +0200 Subject: [PATCH] wip --- ConversationsClassic/AppData/Client/Client.swift | 16 +++++++++------- .../AppData/Store/ConversationStore.swift | 3 --- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ConversationsClassic/AppData/Client/Client.swift b/ConversationsClassic/AppData/Client/Client.swift index 1772053..6e16238 100644 --- a/ConversationsClassic/AppData/Client/Client.swift +++ b/ConversationsClassic/AppData/Client/Client.swift @@ -138,13 +138,15 @@ extension Client { } func requestArchivedMessages(for roster: Roster) async { - if !discoManager.features.map({ $0.xep }).contains("XEP-0313") { - return - } - let module = connection.module(MessageArchiveManagementModule.self) - let endDate = Date() - let startDate = Calendar.current.date(byAdding: .day, value: -Const.mamRequestDaysLength, to: endDate) ?? Date() - let response = try? await module.queryItems(componentJid: JID(credentials.bareJid), with: JID(roster.bareJid), start: startDate, end: endDate, queryId: UUID().uuidString) + print(roster) + + // if !discoManager.features.map({ $0.xep }).contains("XEP-0313") { + // return + // } + // let module = connection.module(MessageArchiveManagementModule.self) + // let endDate = Date() + // let startDate = Calendar.current.date(byAdding: .day, value: -Const.mamRequestDaysLength, to: endDate) ?? Date() + // let response = try? await module.queryItems(componentJid: JID(credentials.bareJid), with: JID(roster.bareJid), start: startDate, end: endDate, queryId: UUID().uuidString) } } diff --git a/ConversationsClassic/AppData/Store/ConversationStore.swift b/ConversationsClassic/AppData/Store/ConversationStore.swift index ef0b3a0..d8a4b56 100644 --- a/ConversationsClassic/AppData/Store/ConversationStore.swift +++ b/ConversationsClassic/AppData/Store/ConversationStore.swift @@ -18,9 +18,6 @@ final class ConversationStore: ObservableObject { self.client = client self.roster = roster subscribe() - Task { - await client.requestArchivedMessages(for: roster) - } } }