浏览代码

pass result of dc_context_open to swift

cyberta 3 年之前
父节点
当前提交
37000936e3

+ 2 - 2
DcCore/DcCore/DC/Wrapper.swift

@@ -124,8 +124,8 @@ public class DcContext {
     }
 
     // The passphrase can be ommited if the account db is not encrypted
-    public func open(passphrase: String? = nil) {
-        dc_context_open(contextPointer, passphrase)
+    public func open(passphrase: String? = nil) -> Bool {
+        dc_context_open(contextPointer, passphrase) == 1
     }
 
     public func isOpen() -> Bool {

+ 1 - 1
deltachat-ios/AppDelegate.swift

@@ -73,7 +73,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         for accountId in accountIds {
             let dcContext = dcAccounts.get(id: accountId)
             if !dcContext.isOpen() {
-                dcContext.open(passphrase: passphrase)
+                _ = dcContext.open(passphrase: passphrase)
             }
         }
 

+ 1 - 1
deltachat-ios/Controller/WelcomeViewController.swift

@@ -181,7 +181,7 @@ class WelcomeViewController: UIViewController, ProgressAlertHandler {
         _ = dcAccounts.remove(id: lastContextId)
         _ = dcAccounts.select(id: newContextId)
         let selected = dcAccounts.getSelected()
-        selected.open(passphrase: try? KeychainManager.getDBSecret())
+        _ = selected.open(passphrase: try? KeychainManager.getDBSecret())
         showAccountSetupController()
     }