Skip to content

Commit

Permalink
Fix password migration to not enable accounts without password
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Dec 17, 2024
1 parent 9c473e8 commit 48744e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Monal/Classes/PasswordMigration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct PasswordMigration: View {
ToolbarItem(placement: .navigationBarTrailing) {
HStack{
Button(action: {
DDLogInfo("Saving migrated accounts: \(String(describing:self.needingMigration))")
DDLogInfo("Saving migrated accounts...")
for id in self.needingMigration.keys {
var dic = self.needingMigration[id]!
//don't show this migration dialog again, even if the user did not activate this account
Expand All @@ -108,6 +108,8 @@ struct PasswordMigration: View {
MLXMPPManager.sharedInstance().connectAccount(dic["account_id"] as! NSNumber)
}
} else {
//make sure to never enable accounts without password
dic["enabled"] = NSNumber(value:false)
DDLogDebug("Updating account in DB: enabled=\(String(describing:dic["enabled"])), needs_password_migration=\(String(describing:dic["needs_password_migration"])), password.count=0")
DataLayer.sharedInstance().updateAccoun(with:dic)
}
Expand Down

0 comments on commit 48744e0

Please sign in to comment.