From 5c52b5e404d33a74f4ce0b19274a5d8f75699c33 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Sat, 15 Feb 2020 17:40:54 +0100 Subject: [PATCH] fix order of shared chats, move pinned up we forgot to respect the new pinned-state for the list of shared chats as it is shown eg. in the profile of a contact. --- src/chatlist.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chatlist.rs b/src/chatlist.rs index 0d2967dbf..e614643a7 100644 --- a/src/chatlist.rs +++ b/src/chatlist.rs @@ -127,13 +127,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 c.id IN(SELECT chat_id FROM chats_contacts WHERE contact_id=?) + AND c.id IN(SELECT chat_id FROM chats_contacts WHERE contact_id=?2) GROUP BY c.id - ORDER BY IFNULL(m.timestamp,c.created_timestamp) DESC, m.id DESC;", - params![MessageState::OutDraft, query_contact_id as i32], + ORDER BY c.archived=?3 DESC, IFNULL(m.timestamp,c.created_timestamp) DESC, m.id DESC;", + params![MessageState::OutDraft, query_contact_id as i32, ChatVisibility::Pinned], process_row, process_rows, )?