ChannelRepository

Repository to read and write Channel data.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun clear()

Clear Channels of this repository.

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

Deletes a Channel by the cid.

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

Deletes a Message from a Channel.messages.

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

Evict a Channel from the repository.

Link copied to clipboard
abstract suspend fun insertChannel(channel: Channel)

Inserts a Channel

Link copied to clipboard
abstract suspend fun insertChannels(channels: Collection<Channel>)

Inserts many Channels.

Link copied to clipboard
abstract suspend fun selectAllCids(): List<String>

Selects all channels' cids.

Link copied to clipboard
abstract suspend fun selectChannel(cid: String): Channel?

Select channel by full channel ID Channel.cid

Link copied to clipboard
abstract suspend fun selectChannelCidsBySyncNeeded(limit: Int = NO_LIMIT): List<String>

Read which channel cids need sync.

Link copied to clipboard
abstract suspend fun selectChannels(channelCIDs: List<String>): List<Channel>

Select channels by full channel IDs Channel.cid

Link copied to clipboard
abstract suspend fun selectChannelsSyncNeeded(limit: Int = NO_LIMIT): List<Channel>

Read which channels need sync.

Link copied to clipboard
abstract suspend fun selectMembersForChannel(cid: String): List<Member>

Reads the member list of a channel.

Link copied to clipboard
abstract suspend fun setChannelDeletedAt(cid: String, deletedAt: Date)

Sets the Channel.deleteAt for a channel.

Link copied to clipboard
abstract suspend fun setHiddenForChannel(cid: String, hidden: Boolean)
abstract suspend fun setHiddenForChannel(cid: String, hidden: Boolean, hideMessagesBefore: Date)

Sets the Channel.hidden for a channel.

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

Updates a Message from a Channel.messages.

Link copied to clipboard
abstract suspend fun updateLastMessageForChannel(cid: String, lastMessage: Message)

Updates the last message for a Channel

Link copied to clipboard
abstract suspend fun updateMembersForChannel(cid: String, members: List<Member>)

Updates the members of a Channel