From f84a0df532dda402a1b5f82961b7cfba73208c4c Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Mon, 23 Dec 2019 13:09:34 +0100 Subject: [PATCH] Sort shortcuts by favorite as well --- .../com/nextcloud/talk/newarch/local/dao/ConversationsDao.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/newarch/local/dao/ConversationsDao.kt b/app/src/main/java/com/nextcloud/talk/newarch/local/dao/ConversationsDao.kt index 36d8d518f..9999fd942 100644 --- a/app/src/main/java/com/nextcloud/talk/newarch/local/dao/ConversationsDao.kt +++ b/app/src/main/java/com/nextcloud/talk/newarch/local/dao/ConversationsDao.kt @@ -30,7 +30,7 @@ abstract class ConversationsDao { @Query("SELECT * FROM conversations WHERE user_id = :userId ORDER BY favorite DESC, last_activity DESC") abstract fun getConversationsForUser(userId: Long): LiveData> - @Query("SELECT * FROM conversations WHERE user_id = :userId ORDER BY last_activity DESC LIMIT 3") + @Query("SELECT * FROM conversations WHERE user_id = :userId ORDER BY favorite DESC, last_activity DESC LIMIT 3") abstract fun getLastThreeConversationsForUser(userId: Long): LiveData> @Query("DELETE FROM conversations WHERE user_id = :userId")