Use bool for from_id_blocked flag

This commit is contained in:
Alexander Krotov
2019-12-09 04:10:56 +03:00
committed by holger krekel
parent 0889467c7b
commit a99b96e36e
2 changed files with 6 additions and 6 deletions

View File

@@ -861,14 +861,14 @@ impl Contact {
.unwrap_or_default() as usize
}
pub fn get_origin_by_id(context: &Context, contact_id: u32, ret_blocked: &mut i32) -> Origin {
pub fn get_origin_by_id(context: &Context, contact_id: u32, ret_blocked: &mut bool) -> Origin {
let mut ret = Origin::Unknown;
*ret_blocked = 0;
*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 = 1;
*ret_blocked = true;
} else {
ret = contact.origin;
}