mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 23:06:32 +03:00
Remove debug printlns, refactor a bit
This commit is contained in:
@@ -1081,7 +1081,6 @@ pub fn dc_get_chat_msgs(
|
|||||||
let process_rows = |rows: rusqlite::MappedRows<_>| {
|
let process_rows = |rows: rusqlite::MappedRows<_>| {
|
||||||
for row in rows {
|
for row in rows {
|
||||||
let (curr_id, ts) = row?;
|
let (curr_id, ts) = row?;
|
||||||
//println!("{}", curr_id);
|
|
||||||
if curr_id as u32 == marker1before {
|
if curr_id as u32 == marker1before {
|
||||||
ret.add_id(1);
|
ret.add_id(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -441,7 +441,6 @@ pub unsafe fn dc_msg_get_timestamp(msg: *const dc_msg_t) -> i64 {
|
|||||||
|
|
||||||
pub fn dc_msg_load_from_db<'a>(msg: *mut dc_msg_t<'a>, context: &'a Context, id: u32) -> bool {
|
pub fn dc_msg_load_from_db<'a>(msg: *mut dc_msg_t<'a>, context: &'a Context, id: u32) -> bool {
|
||||||
if msg.is_null() {
|
if msg.is_null() {
|
||||||
println!("xxx msg is null {}", id);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,15 +475,13 @@ pub fn dc_msg_load_from_db<'a>(msg: *mut dc_msg_t<'a>, context: &'a Context, id:
|
|||||||
(*msg).type_0 = row.get(12)?;
|
(*msg).type_0 = row.get(12)?;
|
||||||
(*msg).state = row.get(13)?;
|
(*msg).state = row.get(13)?;
|
||||||
(*msg).is_dc_message = row.get(14)?;
|
(*msg).is_dc_message = row.get(14)?;
|
||||||
println!("Before2 text: {}", id);
|
(*msg).text = Some(match row.get(15) {
|
||||||
(*msg).text = match row.get(15) {
|
Ok(text) => text,
|
||||||
Ok(text) => Some(text),
|
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!(context, 0, "dc_msg_load_from_db: could not get text column for id {} because of {}", id, e);
|
warn!(context, 0, "dc_msg_load_from_db: could not get text column for id {} because of {}", id, e);
|
||||||
Some("[ Could not read from db ]".to_string())
|
"[ Could not read from db ]".to_string()
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
println!("After text: {}", id);
|
|
||||||
(*msg).param = row.get::<_, String>(16)?.parse().unwrap_or_default();
|
(*msg).param = row.get::<_, String>(16)?.parse().unwrap_or_default();
|
||||||
(*msg).starred = row.get(17)?;
|
(*msg).starred = row.get(17)?;
|
||||||
(*msg).hidden = row.get(18)?;
|
(*msg).hidden = row.get(18)?;
|
||||||
@@ -503,10 +500,13 @@ pub fn dc_msg_load_from_db<'a>(msg: *mut dc_msg_t<'a>, context: &'a Context, id:
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// HERE WE ARE!
|
|
||||||
if let Err(e) = res {
|
if let Err(e) = res {
|
||||||
warn!(context, 0, "Error in msg_load_from_db for id {} because of {}", id, e);
|
warn!(
|
||||||
return false;
|
context,
|
||||||
|
0, "Error in msg_load_from_db for id {} because of {}", id, e
|
||||||
|
);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@@ -650,7 +650,6 @@ pub unsafe fn dc_get_msg<'a>(context: &'a Context, msg_id: uint32_t) -> *mut dc_
|
|||||||
success = true
|
success = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if success {
|
if success {
|
||||||
obj
|
obj
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user