mark current user as approved in message request migration

This commit is contained in:
Ryan Zhao 2022-03-08 13:55:34 +11:00
parent 9a04c7a4fe
commit b1fb202eab
2 changed files with 7 additions and 1 deletions

View File

@ -14,7 +14,6 @@ enum Onboarding {
let user = Contact(sessionID: x25519PublicKey)
user.isApproved = true
user.didApproveMe = true
user.isTrusted = 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)