mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
fix: regressions in dc_msg_get_duration() and dc_delete_contact() (#73)
* fix: regression in dc_msg_get_duration, should return int * fix: regression in dc_delete_contact()
This commit is contained in:
@@ -1290,7 +1290,7 @@ pub unsafe extern "C" fn dc_msg_get_height(msg: *mut dc_msg::dc_msg_t) -> libc::
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_msg_get_duration(msg: *mut dc_msg::dc_msg_t) -> libc::c_int {
|
||||
dc_msg::dc_msg_get_duration(msg) as libc::c_int
|
||||
dc_msg::dc_msg_get_duration(msg)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
@@ -923,7 +923,7 @@ unsafe fn cat_fingerprint(
|
||||
pub unsafe fn dc_delete_contact(context: &dc_context_t, contact_id: uint32_t) -> bool {
|
||||
let mut success = false;
|
||||
let mut stmt: *mut sqlite3_stmt = 0 as *mut sqlite3_stmt;
|
||||
if !contact_id <= 9i32 as libc::c_uint {
|
||||
if !(contact_id <= 9i32 as libc::c_uint) {
|
||||
stmt = dc_sqlite3_prepare(
|
||||
context,
|
||||
&context.sql.clone().read().unwrap(),
|
||||
|
||||
@@ -903,12 +903,12 @@ pub unsafe fn dc_msg_get_height(msg: *const dc_msg_t) -> libc::c_int {
|
||||
dc_param_get_int((*msg).param, 'h' as i32, 0i32)
|
||||
}
|
||||
|
||||
pub unsafe fn dc_msg_get_duration(msg: *const dc_msg_t) -> bool {
|
||||
pub unsafe fn dc_msg_get_duration(msg: *const dc_msg_t) -> libc::c_int {
|
||||
if msg.is_null() || (*msg).magic != 0x11561156i32 as libc::c_uint {
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
0 != dc_param_get_int((*msg).param, 'd' as i32, 0i32)
|
||||
dc_param_get_int((*msg).param, 'd' as i32, 0i32)
|
||||
}
|
||||
|
||||
// TODO should return bool /rtn
|
||||
|
||||
Reference in New Issue
Block a user