All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.com.sceyt.chatuikit.persistence.interactor.ChannelInteractor.kt Maven / Gradle / Ivy

package com.sceyt.chatuikit.persistence.interactor

import com.sceyt.chatuikit.data.models.LoadKeyData
import com.sceyt.chatuikit.data.models.PaginationResponse
import com.sceyt.chatuikit.data.models.SceytResponse
import com.sceyt.chatuikit.data.models.channels.CreateChannelData
import com.sceyt.chatuikit.data.models.channels.EditChannelData
import com.sceyt.chatuikit.data.models.channels.GetAllChannelsResponse
import com.sceyt.chatuikit.data.models.channels.SceytChannel
import com.sceyt.chatuikit.data.models.messages.SceytMessage
import com.sceyt.chatuikit.data.models.messages.SceytUser
import com.sceyt.chatuikit.presentation.components.channel.input.mention.Mention
import com.sceyt.chatuikit.presentation.components.channel.input.format.BodyStyleRange
import kotlinx.coroutines.flow.Flow

interface ChannelInteractor {
    suspend fun loadChannels(offset: Int, searchQuery: String, loadKey: LoadKeyData?,
                             ignoreDb: Boolean): Flow>

    suspend fun searchChannelsWithUserIds(offset: Int, limit: Int, searchQuery: String, userIds: List,
                                          includeUserNames: Boolean, loadKey: LoadKeyData?,
                                          onlyMine: Boolean, ignoreDb: Boolean): Flow>

    suspend fun syncChannels(limit: Int): Flow
    suspend fun markChannelAsRead(channelId: Long): SceytResponse
    suspend fun markChannelAsUnRead(channelId: Long): SceytResponse
    suspend fun clearHistory(channelId: Long, forEveryone: Boolean): SceytResponse
    suspend fun blockAndLeaveChannel(channelId: Long): SceytResponse
    suspend fun deleteChannel(channelId: Long): SceytResponse
    suspend fun leaveChannel(channelId: Long): SceytResponse
    suspend fun findOrCreateDirectChannel(user: SceytUser): SceytResponse
    suspend fun createChannel(createChannelData: CreateChannelData): SceytResponse
    suspend fun muteChannel(channelId: Long, muteUntil: Long): SceytResponse
    suspend fun unMuteChannel(channelId: Long): SceytResponse
    suspend fun enableAutoDelete(channelId: Long, period: Long): SceytResponse
    suspend fun disableAutoDelete(channelId: Long): SceytResponse
    suspend fun pinChannel(channelId: Long): SceytResponse
    suspend fun unpinChannel(channelId: Long): SceytResponse
    suspend fun getChannelFromDb(channelId: Long): SceytChannel?
    suspend fun getDirectChannelFromDb(peerId: String): SceytChannel?
    suspend fun getChannelFromServer(channelId: Long): SceytResponse
    suspend fun getChannelFromServerByUrl(uri: String): SceytResponse>
    suspend fun getChannelsCountFromDb(): Int
    suspend fun editChannel(channelId: Long, data: EditChannelData): SceytResponse
    suspend fun join(channelId: Long): SceytResponse
    suspend fun hideChannel(channelId: Long): SceytResponse
    suspend fun updateDraftMessage(channelId: Long, message: String?, mentionUsers: List,
                                   styling: List?, replyOrEditMessage: SceytMessage?, isReply: Boolean)

    fun getTotalUnreadCount(): Flow
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy