mirror of
https://github.com/chatmail/core.git
synced 2026-05-24 17:26:30 +03:00
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:
@@ -2659,14 +2659,11 @@ void dc_str_unref (char* str);
|
||||
*
|
||||
* @memberof dc_backup_sender_t
|
||||
* @param context The context.
|
||||
* @param folder A Path to a temporary directory where the encrypted database
|
||||
* export will be created. The directory is not automatically cleaned
|
||||
* after the backup is sent.
|
||||
* @return Opaque object for sending the backup.
|
||||
* On errors, NULL is returned and dc_get_last_error()returns an error that
|
||||
* should be shown to the user.
|
||||
*/
|
||||
dc_backup_provider_t* dc_provide_backup (dc_context_t* context, const char* folder);
|
||||
dc_backup_provider_t* dc_provide_backup (dc_context_t* context);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user