Browse Source

Merge branch 'dev' into ipad-support-1

pull/565/head
Ryan Zhao 11 months ago
parent
commit
d3342094a4
  1. 2
      Session/Onboarding/Onboarding.swift
  2. 7
      SignalUtilitiesKit/Database/Migrations/MessageRequestsMigration.swift

2
Session/Onboarding/Onboarding.swift

@ -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 {

7
SignalUtilitiesKit/Database/Migrations/MessageRequestsMigration.swift

@ -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)

Loading…
Cancel
Save