Sort shortcuts by favorite as well

This commit is contained in:
Mario Danic 2019-12-23 13:09:34 +01:00 committed by Mario Đanić
parent 9adb41b7dc
commit f84a0df532

View File

@ -30,7 +30,7 @@ abstract class ConversationsDao {
@Query("SELECT * FROM conversations WHERE user_id = :userId ORDER BY favorite DESC, last_activity DESC") @Query("SELECT * FROM conversations WHERE user_id = :userId ORDER BY favorite DESC, last_activity DESC")
abstract fun getConversationsForUser(userId: Long): LiveData<List<ConversationEntity>> abstract fun getConversationsForUser(userId: Long): LiveData<List<ConversationEntity>>
@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<List<ConversationEntity>> abstract fun getLastThreeConversationsForUser(userId: Long): LiveData<List<ConversationEntity>>
@Query("DELETE FROM conversations WHERE user_id = :userId") @Query("DELETE FROM conversations WHERE user_id = :userId")