mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
Make dc_msg_is_starred() return bool
This commit is contained in:
@@ -1361,7 +1361,7 @@ pub unsafe extern "C" fn dc_msg_is_sent(msg: *mut dc_msg::dc_msg_t) -> libc::c_i
|
|||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn dc_msg_is_starred(msg: *mut dc_msg::dc_msg_t) -> libc::c_int {
|
pub unsafe extern "C" fn dc_msg_is_starred(msg: *mut dc_msg::dc_msg_t) -> libc::c_int {
|
||||||
dc_msg::dc_msg_is_starred(msg)
|
dc_msg::dc_msg_is_starred(msg).into()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|||||||
@@ -246,11 +246,7 @@ unsafe fn log_msg(context: &Context, prefix: impl AsRef<str>, msg: *mut dc_msg_t
|
|||||||
as_str(contact_name),
|
as_str(contact_name),
|
||||||
contact_id,
|
contact_id,
|
||||||
as_str(msgtext),
|
as_str(msgtext),
|
||||||
if 0 != dc_msg_is_starred(msg) {
|
if dc_msg_is_starred(msg) { "★" } else { "" },
|
||||||
"★"
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
},
|
|
||||||
if dc_msg_get_from_id(msg) == 1 as libc::c_uint {
|
if dc_msg_get_from_id(msg) == 1 as libc::c_uint {
|
||||||
""
|
""
|
||||||
} else if dc_msg_get_state(msg) == DC_STATE_IN_SEEN {
|
} else if dc_msg_get_state(msg) == DC_STATE_IN_SEEN {
|
||||||
|
|||||||
@@ -949,12 +949,11 @@ pub unsafe fn dc_msg_is_sent(msg: *const dc_msg_t) -> libc::c_int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO should return bool /rtn
|
pub unsafe fn dc_msg_is_starred(msg: *const dc_msg_t) -> bool {
|
||||||
pub unsafe fn dc_msg_is_starred(msg: *const dc_msg_t) -> libc::c_int {
|
|
||||||
if msg.is_null() || (*msg).magic != 0x11561156i32 as libc::c_uint {
|
if msg.is_null() || (*msg).magic != 0x11561156i32 as libc::c_uint {
|
||||||
return 0i32;
|
return false;
|
||||||
}
|
}
|
||||||
return if 0 != (*msg).starred { 1i32 } else { 0i32 };
|
0 != (*msg).starred
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO should return bool /rtn
|
// TODO should return bool /rtn
|
||||||
|
|||||||
Reference in New Issue
Block a user