diff --git a/src/chat.rs b/src/chat.rs index 9961e4c4f..6a2327408 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -2136,8 +2136,8 @@ SELECT c.selfavatar_sent .fetch(&pool); while let Some(row) = rows.next().await { - let (selfavatar_sent,): (i64,) = row?; - if selfavatar_sent < timestamp_some_days_ago { + let (selfavatar_sent,): (i32,) = row?; + if (selfavatar_sent as i64) < timestamp_some_days_ago { needs_attach = true; } } diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index eb367b146..ec37c5b42 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -848,7 +848,7 @@ async fn calc_sort_timestamp( // get newest non fresh message for this chat // update sort_timestamp if less than that if is_fresh_msg { - let last_msg_time: Result = context + let last_msg_time: Result = context .sql .query_value( "SELECT MAX(timestamp) FROM msgs WHERE chat_id=? AND state>?", @@ -857,8 +857,8 @@ async fn calc_sort_timestamp( .await; if let Ok(last_msg_time) = last_msg_time { - if last_msg_time > sort_timestamp { - sort_timestamp = last_msg_time; + if last_msg_time as i64 > sort_timestamp { + sort_timestamp = last_msg_time as i64; } } } @@ -1458,7 +1458,7 @@ async fn search_chat_ids_by_contact_ids( let mut mismatches = 0; while let Some(row) = rows.next().await { - let (chat_id, contact_id): (ChatId, i64) = row?; + let (chat_id, contact_id): (ChatId, i32) = row?; let contact_id = contact_id as u32; if chat_id != last_chat_id {