Browse Source

update to synchronous version of mr_mailbox_configure_and_connect

Jonas Reinsch 7 years ago
parent
commit
b02cef611c
2 changed files with 10 additions and 7 deletions
  1. 1 1
      deltachat-ios/AppCoordinator.swift
  2. 9 6
      deltachat-ios/AppDelegate.swift

+ 1 - 1
deltachat-ios/AppCoordinator.swift

@@ -62,7 +62,7 @@ class AppCoordinator: Coordinator {
         settingsNavigationController.tabBarItem = settingsTabbarItem
         
         tabBarController.viewControllers = [
-//            contactNavigationController,
+            contactNavigationController,
             chatNavigationController,
             settingsNavigationController,
         ]

+ 9 - 6
deltachat-ios/AppDelegate.swift

@@ -41,12 +41,12 @@ public func callbackSwift(event: CInt, data1: CUnsignedLong, data2: CUnsignedLon
     // TODO
     // this will become a synchronous API, start thread directly
     // from
-    case MR_EVENT_CONFIGURE_ENDED:
-        if data1 == 0 {
-            fatalError("MR_EVENT_CONFIGURE_ENDED: (TODO: add dialogue here)")
-        } else {
+//    case MR_EVENT_CONFIGURE_ENDED:
+//        if data1 == 0 {
+//            fatalError("MR_EVENT_CONFIGURE_ENDED: (TODO: add dialogue here)")
+//        } else {
 //            sendTestMessage(name: "Q", email: "quickmsgtest1@b44t.com", text: "hugu")
-        }
+//        }
         
         break
 //        mrmailbox_send
@@ -126,7 +126,10 @@ func initCore(withCredentials: Bool, email: String = "", password: String = "")
         UserDefaults.standard.synchronize()
     }
     
-    mrmailbox_configure_and_connect(mailboxPointer)
+    DispatchQueue.global(qos: .default).async {
+        mrmailbox_configure_and_connect(mailboxPointer)
+        print("finished")
+    }
     
     addVibrationOnIncomingMessage()
 }