mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 02:16:29 +03:00
Implement dc_array_t::is_empty()
This commit is contained in:
@@ -38,6 +38,10 @@ impl dc_array_t {
|
||||
pub fn add_id(&mut self, item: uint32_t) {
|
||||
self.add_uint(item as uintptr_t);
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.array.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2164,7 +2164,7 @@ pub unsafe fn dc_chat_get_profile_image(chat: *const Chat) -> *mut libc::c_char
|
||||
image_abs = dc_get_abs_path((*chat).context, image_rel)
|
||||
} else if (*chat).type_0 == 100i32 {
|
||||
contacts = dc_get_chat_contacts((*chat).context, (*chat).id);
|
||||
if !(*contacts).array.is_empty() {
|
||||
if !(*contacts).is_empty() {
|
||||
contact = dc_get_contact((*chat).context, (*contacts).array[0] as uint32_t);
|
||||
image_abs = dc_contact_get_profile_image(contact)
|
||||
}
|
||||
@@ -2185,7 +2185,7 @@ pub unsafe fn dc_chat_get_color(chat: *const Chat) -> uint32_t {
|
||||
if !(chat.is_null() || (*chat).magic != 0xc4a7c4a7u32) {
|
||||
if (*chat).type_0 == 100i32 {
|
||||
contacts = dc_get_chat_contacts((*chat).context, (*chat).id);
|
||||
if !(*contacts).array.is_empty() {
|
||||
if !(*contacts).is_empty() {
|
||||
contact = dc_get_contact((*chat).context, (*contacts).array[0] as uint32_t);
|
||||
color = dc_str_to_color((*contact).addr) as uint32_t
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user