Remove the need for a directory for db export

Plus on import use the context directory.  We can actually write there
just fine.
This commit is contained in:
Floris Bruynooghe
2023-02-16 16:06:41 +01:00
parent dcce6ef50b
commit 490a14c5ef
9 changed files with 48 additions and 48 deletions

View File

@@ -4136,16 +4136,14 @@ pub type dc_backup_provider_t = BackupProvider;
#[no_mangle]
pub unsafe extern "C" fn dc_provide_backup(
context: *mut dc_context_t,
folder: *const libc::c_char,
) -> *mut dc_backup_provider_t {
if context.is_null() {
eprintln!("ignoring careless call to dc_send_backup()");
return ptr::null_mut();
}
let ctx = &*context;
let dir = as_path(folder);
block_on(async move {
BackupProvider::prepare(ctx, dir)
BackupProvider::prepare(ctx)
.await
.map(|provider| Box::into_raw(Box::new(provider)))
.log_err(ctx, "BackupProvider failed")