fix(chat): remove recursive sql usage

This commit is contained in:
dignifiedquire
2019-07-20 16:17:25 +02:00
parent 1ad45ed4d6
commit d353d9d9d8

View File

@@ -147,7 +147,13 @@ pub fn dc_chat_load_from_db(chat: *mut Chat, chat_id: u32) -> bool {
c.blocked = row.get(6)?; c.blocked = row.get(6)?;
c.gossiped_timestamp = row.get(7)?; c.gossiped_timestamp = row.get(7)?;
c.is_sending_locations = row.get(8)?; c.is_sending_locations = row.get(8)?;
Ok(())
},
);
match res {
Ok(_) => {
let c = unsafe { &mut *chat };
match c.id { match c.id {
1 => unsafe { 1 => unsafe {
free((*chat).name as *mut libc::c_void); free((*chat).name as *mut libc::c_void);
@@ -176,12 +182,8 @@ pub fn dc_chat_load_from_db(chat: *mut Chat, chat_id: u32) -> bool {
} }
} }
} }
Ok(()) true
}, }
);
match res {
Ok(_) => true,
Err(err) => { Err(err) => {
error!( error!(
context, context,