diff --git a/Sources/Integration/Session/Session.swift b/Sources/Integration/Session/Session.swift index ef6180d7cf2c1a507c5bb98633a58204e89ea514..e14c4901e1a22fe97869768b154ec25dd70eff93 100644 --- a/Sources/Integration/Session/Session.swift +++ b/Sources/Integration/Session/Session.swift @@ -403,9 +403,10 @@ public final class Session: SessionType { /// This will get called when my contact restore its contact. /// TODO: Hold a record on the chat that this contact restored. /// - var contact = $0 - contact.authStatus = .friend - _ = try? dbManager.saveContact(contact) + if var contact = try? dbManager.fetchContacts(.init(id: [$0.id])).first { + contact.authStatus = .friend + _ = try? dbManager.saveContact(contact) + } }.store(in: &cancellables) backupService.settingsPublisher