mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
Change return type of `dc_is_configured' to bool
This commit is contained in:
@@ -233,7 +233,7 @@ pub unsafe extern "C" fn dc_is_configured(context: *mut dc_context_t) -> libc::c
|
|||||||
|
|
||||||
let context = &*context;
|
let context = &*context;
|
||||||
|
|
||||||
configure::dc_is_configured(context)
|
configure::dc_is_configured(context) as libc::c_int
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|||||||
@@ -45,16 +45,16 @@ pub unsafe fn configure(context: &Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Check if the context is already configured.
|
/// 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
|
if context
|
||||||
.sql
|
.sql
|
||||||
.get_config_int(context, "configured")
|
.get_config_int(context, "configured")
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
> 0
|
> 0
|
||||||
{
|
{
|
||||||
1
|
true
|
||||||
} else {
|
} else {
|
||||||
0
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -581,7 +581,7 @@ unsafe fn import_backup(context: &Context, backup_to_import: *const libc::c_char
|
|||||||
.map_or("<<None>>", |p| p.to_str().unwrap())
|
.map_or("<<None>>", |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.");
|
error!(context, 0, "Cannot import backups to accounts in use.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user