mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
mark current user as approved in message request migration
This commit is contained in:
parent
9a04c7a4fe
commit
b1fb202eab
|
@ -14,7 +14,6 @@ enum Onboarding {
|
||||||
let user = Contact(sessionID: x25519PublicKey)
|
let user = Contact(sessionID: x25519PublicKey)
|
||||||
user.isApproved = true
|
user.isApproved = true
|
||||||
user.didApproveMe = true
|
user.didApproveMe = true
|
||||||
user.isTrusted = true
|
|
||||||
Storage.shared.setContact(user, using: transaction)
|
Storage.shared.setContact(user, using: transaction)
|
||||||
}
|
}
|
||||||
switch self {
|
switch self {
|
||||||
|
|
|
@ -41,6 +41,13 @@ public class MessageRequestsMigration : OWSDatabaseMigration {
|
||||||
threads.append(thread)
|
threads.append(thread)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let user = Storage.shared.getUser() {
|
||||||
|
user.isApproved = true
|
||||||
|
user.didApproveMe = true
|
||||||
|
contacts.insert(user)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Storage.write(with: { transaction in
|
Storage.write(with: { transaction in
|
||||||
contacts.forEach { contact in
|
contacts.forEach { contact in
|
||||||
Storage.shared.setContact(contact, using: transaction)
|
Storage.shared.setContact(contact, using: transaction)
|
||||||
|
|
Loading…
Reference in a new issue