rename has_device_msg() to was_device_msg_ever_added() what describes better what the function is doing

This commit is contained in:
B. Petersen
2019-11-19 13:21:02 +01:00
parent 700e10bc0e
commit e4e6a00fe4
3 changed files with 12 additions and 11 deletions

View File

@@ -842,18 +842,19 @@ pub unsafe extern "C" fn dc_add_device_msg(
}
#[no_mangle]
pub unsafe extern "C" fn dc_has_device_msg(
pub unsafe extern "C" fn dc_was_device_msg_ever_added(
context: *mut dc_context_t,
label: *const libc::c_char,
) -> libc::c_int {
if context.is_null() || label.is_null() {
eprintln!("ignoring careless call to dc_has_device_msg()");
eprintln!("ignoring careless call to dc_was_device_msg_ever_added()");
return 0;
}
let ffi_context = &mut *context;
ffi_context
.with_inner(|ctx| {
chat::has_device_msg(ctx, &to_string_lossy(label)).unwrap_or(false) as libc::c_int
chat::was_device_msg_ever_added(ctx, &to_string_lossy(label)).unwrap_or(false)
as libc::c_int
})
.unwrap_or(0)
}