fix ffi and bindings, error is already logged in core

This commit is contained in:
B. Petersen
2020-10-04 18:54:21 +02:00
parent 47f4f2bd08
commit 66cb3d4358
3 changed files with 7 additions and 13 deletions

View File

@@ -1068,7 +1068,7 @@ pub unsafe extern "C" fn dc_set_chat_protection(
return 0;
}
let ctx = &*context;
let protect = if let Some(s) = contact::ProtectionStatus::from_i32(protect) {
let protect = if let Some(s) = ProtectionStatus::from_i32(protect) {
s
} else {
eprintln!("bad protect-value for dc_set_chat_protection()");
@@ -1078,10 +1078,7 @@ pub unsafe extern "C" fn dc_set_chat_protection(
block_on(async move {
match ChatId::new(chat_id).set_protection(&ctx, protect).await {
Ok(()) => 1,
Err(err) => {
error!(ctx, "Cannot protect chat. Are all members verified?");
0
}
Err(_) => 0,
}
})
}
@@ -1207,7 +1204,7 @@ pub unsafe extern "C" fn dc_create_group_chat(
return 0;
}
let ctx = &*context;
let protect = if let Some(s) = contact::ProtectionStatus::from_i32(protect) {
let protect = if let Some(s) = ProtectionStatus::from_i32(protect) {
s
} else {
return 0;