diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index bdb89109e..0022b70fc 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -233,7 +233,7 @@ pub unsafe extern "C" fn dc_is_configured(context: *mut dc_context_t) -> libc::c let context = &*context; - configure::dc_is_configured(context) + configure::dc_is_configured(context) as libc::c_int } #[no_mangle] diff --git a/src/configure/mod.rs b/src/configure/mod.rs index e230ce9c0..86b5274fd 100644 --- a/src/configure/mod.rs +++ b/src/configure/mod.rs @@ -45,16 +45,16 @@ pub unsafe fn configure(context: &Context) { } /// Check if the context is already configured. -pub fn dc_is_configured(context: &Context) -> libc::c_int { +pub fn dc_is_configured(context: &Context) -> bool { if context .sql .get_config_int(context, "configured") .unwrap_or_default() > 0 { - 1 + true } else { - 0 + false } } diff --git a/src/dc_imex.rs b/src/dc_imex.rs index d9d785ba5..2222d0a4b 100644 --- a/src/dc_imex.rs +++ b/src/dc_imex.rs @@ -581,7 +581,7 @@ unsafe fn import_backup(context: &Context, backup_to_import: *const libc::c_char .map_or("<>", |p| p.to_str().unwrap()) ); - if 0 != dc_is_configured(context) { + if dc_is_configured(context) { error!(context, 0, "Cannot import backups to accounts in use."); return 0; }