wip
This commit is contained in:
parent
7df723e62d
commit
ac09086eaa
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,6 @@ final class ConversationStore: ObservableObject {
|
|||
self.client = client
|
||||
self.roster = roster
|
||||
subscribe()
|
||||
Task {
|
||||
await client.requestArchivedMessages(for: roster)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue