forked from upstream-mirrors/quik
Divide MessageRepository into itself and Conversation Repository
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package repository
|
||||
|
||||
import io.realm.RealmResults
|
||||
import model.Conversation
|
||||
import model.SearchResult
|
||||
|
||||
interface ConversationRepository {
|
||||
|
||||
fun getConversations(archived: Boolean = false): RealmResults<Conversation>
|
||||
|
||||
fun getConversationsSnapshot(): List<Conversation>
|
||||
|
||||
fun setConversationName(id: Long, name: String)
|
||||
|
||||
fun searchConversations(query: String): List<SearchResult>
|
||||
|
||||
fun getBlockedConversations(): RealmResults<Conversation>
|
||||
|
||||
fun getConversationAsync(threadId: Long): Conversation
|
||||
|
||||
fun getConversation(threadId: Long): Conversation?
|
||||
|
||||
fun getOrCreateConversation(threadId: Long): Conversation?
|
||||
|
||||
fun getOrCreateConversation(address: String): Conversation?
|
||||
|
||||
fun getOrCreateConversation(addresses: List<String>): Conversation?
|
||||
|
||||
fun saveDraft(threadId: Long, draft: String)
|
||||
|
||||
/**
|
||||
* Updates message-related fields in the conversation, like the date and snippet
|
||||
*/
|
||||
fun updateConversations(vararg threadIds: Long)
|
||||
|
||||
fun markArchived(vararg threadIds: Long)
|
||||
|
||||
fun markUnarchived(vararg threadIds: Long)
|
||||
|
||||
fun markBlocked(vararg threadIds: Long)
|
||||
|
||||
fun markUnblocked(vararg threadIds: Long)
|
||||
|
||||
fun deleteConversations(vararg threadIds: Long)
|
||||
|
||||
}
|
||||
@@ -20,35 +20,11 @@ package repository
|
||||
|
||||
import io.realm.RealmResults
|
||||
import model.Attachment
|
||||
import model.Conversation
|
||||
import model.Message
|
||||
import model.MmsPart
|
||||
import model.SearchResult
|
||||
|
||||
interface MessageRepository {
|
||||
|
||||
fun getConversations(archived: Boolean = false): RealmResults<Conversation>
|
||||
|
||||
fun getConversationsSnapshot(): List<Conversation>
|
||||
|
||||
fun setConversationName(id: Long, name: String)
|
||||
|
||||
fun searchConversations(query: String): List<SearchResult>
|
||||
|
||||
fun getBlockedConversations(): RealmResults<Conversation>
|
||||
|
||||
fun getConversationAsync(threadId: Long): Conversation
|
||||
|
||||
fun getConversation(threadId: Long): Conversation?
|
||||
|
||||
fun getOrCreateConversation(threadId: Long): Conversation?
|
||||
|
||||
fun getOrCreateConversation(address: String): Conversation?
|
||||
|
||||
fun getOrCreateConversation(addresses: List<String>): Conversation?
|
||||
|
||||
fun saveDraft(threadId: Long, draft: String)
|
||||
|
||||
fun getMessages(threadId: Long, query: String = ""): RealmResults<Message>
|
||||
|
||||
fun getMessage(id: Long): Message?
|
||||
@@ -73,19 +49,6 @@ interface MessageRepository {
|
||||
*/
|
||||
fun getUnreadMessages(threadId: Long): RealmResults<Message>
|
||||
|
||||
/**
|
||||
* Updates message-related fields in the conversation, like the date and snippet
|
||||
*/
|
||||
fun updateConversations(vararg threadIds: Long)
|
||||
|
||||
fun markArchived(vararg threadIds: Long)
|
||||
|
||||
fun markUnarchived(vararg threadIds: Long)
|
||||
|
||||
fun markBlocked(vararg threadIds: Long)
|
||||
|
||||
fun markUnblocked(vararg threadIds: Long)
|
||||
|
||||
fun markAllSeen()
|
||||
|
||||
fun markSeen(threadId: Long)
|
||||
@@ -130,6 +93,4 @@ interface MessageRepository {
|
||||
|
||||
fun deleteMessages(vararg messageIds: Long)
|
||||
|
||||
fun deleteConversations(vararg threadIds: Long)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user