mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 23:36:30 +03:00
Use footer as a contact status
This commit is contained in:
@@ -4099,6 +4099,19 @@ char* dc_contact_get_profile_image (const dc_contact_t* contact);
|
||||
uint32_t dc_contact_get_color (const dc_contact_t* contact);
|
||||
|
||||
|
||||
/**
|
||||
* Get the contact's status.
|
||||
*
|
||||
* Status is the last signature received in a message from this contact.
|
||||
*
|
||||
* @memberof dc_contact_t
|
||||
* @param contact The contact object.
|
||||
* @return Contact status, if any.
|
||||
* Empty string otherwise.
|
||||
* Must be released by using dc_str_unref() after usage.
|
||||
*/
|
||||
char* dc_contact_get_status (const dc_contact_t* contact);
|
||||
|
||||
/**
|
||||
* Check if a contact is blocked.
|
||||
*
|
||||
|
||||
@@ -3275,6 +3275,16 @@ pub unsafe extern "C" fn dc_contact_get_color(contact: *mut dc_contact_t) -> u32
|
||||
ffi_contact.contact.get_color()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_contact_get_status(contact: *mut dc_contact_t) -> *mut libc::c_char {
|
||||
if contact.is_null() {
|
||||
eprintln!("ignoring careless call to dc_contact_get_status()");
|
||||
return "".strdup();
|
||||
}
|
||||
let ffi_contact = &*contact;
|
||||
ffi_contact.contact.get_status().strdup()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_contact_is_blocked(contact: *mut dc_contact_t) -> libc::c_int {
|
||||
if contact.is_null() {
|
||||
|
||||
Reference in New Issue
Block a user