This commit is contained in:
fmodf 2024-07-24 15:35:17 +02:00
parent 3756dfa527
commit 9155aa5ad8

View file

@ -73,13 +73,7 @@ final class XMPPService: ObservableObject {
}
.store(in: &clientMessagesCancellables)
// enable carbons if available
client.module(.messageCarbons).$isAvailable.filter { $0 }
.sink(receiveValue: { [weak client] _ in
client?.module(.messageCarbons).enable()
})
.store(in: &clientMessagesCancellables)
// subscribe to archived messages
client.module(.mam).archivedMessagesPublisher
.sink(receiveValue: { [weak self] archived in
let message = archived.message
@ -88,6 +82,13 @@ final class XMPPService: ObservableObject {
})
.store(in: &clientMessagesCancellables)
// enable carbons if available
client.module(.messageCarbons).$isAvailable.filter { $0 }
.sink(receiveValue: { [weak client] _ in
client?.module(.messageCarbons).enable()
})
.store(in: &clientMessagesCancellables)
// finally, do login
client.login()
}