mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
target comments from @flub
This commit is contained in:
@@ -958,10 +958,8 @@ impl rusqlite::types::FromSql for ChatVisibility {
|
||||
2 => Ok(ChatVisibility::Pinned),
|
||||
1 => Ok(ChatVisibility::Archived),
|
||||
0 => Ok(ChatVisibility::Normal),
|
||||
n => {
|
||||
// unknown archived state, falling back to normal state (was this db opened with a newer deltachat version?)
|
||||
Err(rusqlite::types::FromSqlError::OutOfRange(n))
|
||||
}
|
||||
// fallback to to Normal for unknown values, may happen eg. on imports created by a newer version.
|
||||
_ => Ok(ChatVisibility::Normal),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -199,13 +199,13 @@ impl Chatlist {
|
||||
SELECT MAX(timestamp)
|
||||
FROM msgs
|
||||
WHERE chat_id=c.id
|
||||
AND (hidden=0 OR state=?))
|
||||
AND (hidden=0 OR state=?1))
|
||||
WHERE c.id>9
|
||||
AND c.blocked=0
|
||||
AND NOT c.archived=1
|
||||
AND NOT c.archived=?2
|
||||
GROUP BY c.id
|
||||
ORDER BY c.archived=2 DESC, IFNULL(m.timestamp,c.created_timestamp) DESC, m.id DESC;",
|
||||
params![MessageState::OutDraft],
|
||||
ORDER BY c.archived=?3 DESC, IFNULL(m.timestamp,c.created_timestamp) DESC, m.id DESC;",
|
||||
params![MessageState::OutDraft, ChatVisibility::Archived, ChatVisibility::Pinned],
|
||||
process_row,
|
||||
process_rows,
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user