|
@@ -23,6 +23,10 @@ public class DcAccounts {
|
|
|
return Int(dc_accounts_migrate_account(accountsPointer, dbLocation))
|
|
|
}
|
|
|
|
|
|
+ public func addClosedAccount() -> Int {
|
|
|
+ return Int(dc_accounts_add_closed_account(accountsPointer))
|
|
|
+ }
|
|
|
+
|
|
|
public func add() -> Int {
|
|
|
return Int(dc_accounts_add_account(accountsPointer))
|
|
|
}
|
|
@@ -119,6 +123,15 @@ public class DcContext {
|
|
|
return swiftString
|
|
|
}
|
|
|
|
|
|
+ // 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 isOpen() -> Bool {
|
|
|
+ return dc_context_is_open(contextPointer) == 1
|
|
|
+ }
|
|
|
+
|
|
|
// viewType: one of DC_MSG_*
|
|
|
public func newMessage(viewType: Int32) -> DcMsg {
|
|
|
let messagePointer = dc_msg_new(contextPointer, viewType)
|