wip
This commit is contained in:
parent
7df723e62d
commit
ac09086eaa
|
@ -138,13 +138,15 @@ extension Client {
|
||||||
}
|
}
|
||||||
|
|
||||||
func requestArchivedMessages(for roster: Roster) async {
|
func requestArchivedMessages(for roster: Roster) async {
|
||||||
if !discoManager.features.map({ $0.xep }).contains("XEP-0313") {
|
print(roster)
|
||||||
return
|
|
||||||
}
|
// if !discoManager.features.map({ $0.xep }).contains("XEP-0313") {
|
||||||
let module = connection.module(MessageArchiveManagementModule.self)
|
// return
|
||||||
let endDate = Date()
|
// }
|
||||||
let startDate = Calendar.current.date(byAdding: .day, value: -Const.mamRequestDaysLength, to: endDate) ?? Date()
|
// let module = connection.module(MessageArchiveManagementModule.self)
|
||||||
let response = try? await module.queryItems(componentJid: JID(credentials.bareJid), with: JID(roster.bareJid), start: startDate, end: endDate, queryId: UUID().uuidString)
|
// 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.client = client
|
||||||
self.roster = roster
|
self.roster = roster
|
||||||
subscribe()
|
subscribe()
|
||||||
Task {
|
|
||||||
await client.requestArchivedMessages(for: roster)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue