Remove get_origin_by_id

This commit is contained in:
Alexander Krotov
2019-12-28 11:09:02 +01:00
parent 25842894d2
commit a31c6d82c9
2 changed files with 5 additions and 18 deletions

View File

@@ -63,7 +63,7 @@ pub struct Contact {
addr: String,
/// Blocked state. Use dc_contact_is_blocked to access this field.
blocked: bool,
pub blocked: bool,
/// The origin/source of the contact.
pub origin: Origin,
@@ -892,22 +892,6 @@ impl Contact {
.unwrap_or_default() as usize
}
pub fn get_origin_by_id(context: &Context, contact_id: u32, ret_blocked: &mut bool) -> Origin {
let mut ret = Origin::Unknown;
*ret_blocked = false;
if let Ok(contact) = Contact::load_from_db(context, contact_id) {
/* we could optimize this by loading only the needed fields */
if contact.blocked {
*ret_blocked = true;
} else {
ret = contact.origin;
}
}
ret
}
pub fn real_exists_by_id(context: &Context, contact_id: u32) -> bool {
if !context.sql.is_open() || contact_id <= DC_CONTACT_ID_LAST_SPECIAL {
return false;