Handle conversations with scheduled messages only
This commit is contained in:
parent
f837790948
commit
ee8130c767
11 changed files with 171 additions and 36 deletions
|
|
@ -14,6 +14,9 @@ interface ConversationsDao {
|
|||
@Query("SELECT * FROM conversations")
|
||||
fun getAll(): List<Conversation>
|
||||
|
||||
@Query("SELECT * FROM conversations where thread_id = :threadId")
|
||||
fun getConversationWithThreadId(threadId: Long): Conversation?
|
||||
|
||||
@Query("SELECT * FROM conversations WHERE read = 0")
|
||||
fun getUnreadConversations(): List<Conversation>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ interface MessagesDao {
|
|||
@Query("SELECT * FROM messages WHERE thread_id = :threadId")
|
||||
fun getThreadMessages(threadId: Long): List<Message>
|
||||
|
||||
@Query("SELECT * FROM messages WHERE thread_id = :threadId AND is_scheduled")
|
||||
@Query("SELECT * FROM messages WHERE thread_id = :threadId AND is_scheduled = 1")
|
||||
fun getScheduledThreadMessages(threadId: Long): List<Message>
|
||||
|
||||
@Query("SELECT * FROM messages WHERE thread_id = :threadId AND id = :messageId AND is_scheduled")
|
||||
@Query("SELECT * FROM messages WHERE thread_id = :threadId AND id = :messageId AND is_scheduled = 1")
|
||||
fun getScheduledMessageWithId(threadId: Long, messageId: Long): Message
|
||||
|
||||
@Query("SELECT * FROM messages WHERE body LIKE :text")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue