implement dc_set_config_from_qr()

This commit is contained in:
B. Petersen
2020-02-11 02:12:44 +01:00
committed by holger krekel
parent 2b7a0a4585
commit 8b4edc46a7
3 changed files with 56 additions and 7 deletions

View File

@@ -435,7 +435,13 @@ pub unsafe extern "C" fn dc_set_config_from_qr(
let qr = to_string_lossy(qr);
let ffi_context = &*context;
ffi_context
.with_inner(|ctx| qr::set_config_from_qr(ctx, &qr) as libc::c_int)
.with_inner(|ctx| match qr::set_config_from_qr(ctx, &qr) {
Ok(()) => 1,
Err(err) => {
error!(ctx, "Failed to create account from QR code: {}", err);
0
}
})
.unwrap_or(0)
}