mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
remove dc_accounts_import_account() api
in most (all?) UIs, import/export works on an already created account, so, dc_accounts_import_account() does not really help here - but adds some noise and confusion eg. as for the other dc_accounts_t functions, the corrsponding dc_context_t functions must not be called. if really a new account is required for import, it seems to be easier to call add_account() before import.
This commit is contained in:
@@ -3799,23 +3799,6 @@ pub unsafe extern "C" fn dc_accounts_get_all(accounts: *mut dc_accounts_t) -> *m
|
||||
Box::into_raw(Box::new(array))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_accounts_import_account(
|
||||
accounts: *mut dc_accounts_t,
|
||||
file: *const libc::c_char,
|
||||
) -> u32 {
|
||||
if accounts.is_null() || file.is_null() {
|
||||
eprintln!("ignoring careless call to dc_accounts_import_account()");
|
||||
return 0;
|
||||
}
|
||||
|
||||
let accounts = &*accounts;
|
||||
let file = to_string_lossy(file);
|
||||
block_on(accounts.import_account(async_std::path::PathBuf::from(file)))
|
||||
.map(|_| 1)
|
||||
.unwrap_or_else(|_| 0)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_accounts_start_io(accounts: *mut dc_accounts_t) {
|
||||
if accounts.is_null() {
|
||||
|
||||
Reference in New Issue
Block a user