wip
This commit is contained in:
parent
bfb7bd00aa
commit
ae767456dd
|
@ -25,6 +25,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationDidEnterBackground(_: UIApplication) {
|
func applicationDidEnterBackground(_: UIApplication) {
|
||||||
MLXMPPManager.sharedInstance().nowBackgrounded()
|
// MLXMPPManager.sharedInstance().nowBackgrounded()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,7 @@ final class WrapperChat: ObservableObject {
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
notificationObservers.forEach { NotificationCenter.default.removeObserver($0) }
|
notificationObservers.forEach { NotificationCenter.default.removeObserver($0) }
|
||||||
|
print("Chat wrapper deinit")
|
||||||
}
|
}
|
||||||
|
|
||||||
var chatTitle: String {
|
var chatTitle: String {
|
||||||
|
@ -139,6 +140,7 @@ private extension WrapperChat {
|
||||||
default:
|
default:
|
||||||
guard let mlMessage = notification.userInfo?["message"] as? MLMessage else { return }
|
guard let mlMessage = notification.userInfo?["message"] as? MLMessage else { return }
|
||||||
guard let message = Message(mlMessage) else { return }
|
guard let message = Message(mlMessage) else { return }
|
||||||
|
guard message.accountId == contact.ownerId, message.participantJid == contact.contactJid else { return }
|
||||||
if let index = messages.firstIndex(where: { $0.id == message.id }) {
|
if let index = messages.firstIndex(where: { $0.id == message.id }) {
|
||||||
messages[index] = message
|
messages[index] = message
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -30,6 +30,7 @@ final class WrapperXMPP: ObservableObject {
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
notificationObservers.forEach { NotificationCenter.default.removeObserver($0) }
|
notificationObservers.forEach { NotificationCenter.default.removeObserver($0) }
|
||||||
|
print("XMPP wrapper deinit")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue