Merge pull request #572 from RyanRory/fix-closed-group-not-restored

Fix closed groups not restored
This commit is contained in:
RyanZhao 2022-03-08 14:02:02 +11:00 committed by GitHub
commit 49c995ee92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,8 @@ enum Onboarding {
TSAccountManager.sharedInstance().phoneNumberAwaitingVerification = x25519PublicKey
Storage.writeSync { transaction in
let user = Contact(sessionID: x25519PublicKey)
user.isApproved = true
user.didApproveMe = true
Storage.shared.setContact(user, using: transaction)
}
switch self {

View File

@ -41,6 +41,13 @@ public class MessageRequestsMigration : OWSDatabaseMigration {
threads.append(thread)
}
if let user = Storage.shared.getUser() {
user.isApproved = true
user.didApproveMe = true
contacts.insert(user)
}
Storage.write(with: { transaction in
contacts.forEach { contact in
Storage.shared.setContact(contact, using: transaction)