MessageRepository

Repository to read and write Message data.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun clear()

Clear messages of this repository.

Link copied to clipboard
abstract suspend fun deleteChannelMessage(message: Message)

Deletes message.

Link copied to clipboard
abstract suspend fun deleteChannelMessages(cid: String)

Deletes all messages from a channel.

Link copied to clipboard
abstract suspend fun deleteChannelMessagesBefore(cid: String, hideMessagesBefore: Date)

Deletes all messages before a message with passed ID.

Link copied to clipboard
abstract suspend fun evictMessage(messageId: String)

Evicts a message from the repository.

Link copied to clipboard
abstract suspend fun evictMessages()

Evict messages from the repository.

Link copied to clipboard
abstract suspend fun insertMessage(message: Message)

Inserts a messages.

Link copied to clipboard
abstract suspend fun insertMessages(messages: List<Message>)

Inserts many messages.

Link copied to clipboard
abstract suspend fun selectMessage(messageId: String): Message?

Reads the message with passed ID.

Link copied to clipboard
abstract suspend fun selectMessageBySyncState(syncStatus: SyncStatus): List<Message>

Selects all message of a SyncStatus

Link copied to clipboard
abstract suspend fun selectMessageIdsBySyncState(syncStatus: SyncStatus): List<String>

Selects all message ids of a SyncStatus

Link copied to clipboard
abstract suspend fun selectMessages(messageIds: List<String>): List<Message>

Selects messages by IDs.

Link copied to clipboard
abstract suspend fun selectMessagesForChannel(cid: String, pagination: AnyChannelPaginationRequest?): List<Message>

Select messages for a channel in a desired page.

Link copied to clipboard
abstract suspend fun selectMessagesForThread(messageId: String, limit: Int): List<Message>

Select messages for a thread in a desired page.

Link copied to clipboard
abstract suspend fun selectMessagesWithPoll(pollId: String): List<Message>

Selects all messages with a poll with the passed ID.