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

main.com.sceyt.chatuikit.persistence.PersistenceMiddleWareImpl.kt Maven / Gradle / Ivy

There is a newer version: 1.7.2
Show newest version
package com.sceyt.chatuikit.persistence

import com.sceyt.chat.models.message.DeleteMessageType
import com.sceyt.chat.models.message.Message
import com.sceyt.chat.models.message.MessageListMarker
import com.sceyt.chat.models.settings.UserSettings
import com.sceyt.chat.models.user.PresenceState
import com.sceyt.chatuikit.data.managers.channel.event.ChannelEventData
import com.sceyt.chatuikit.data.managers.channel.ChannelEventManager
import com.sceyt.chatuikit.data.managers.channel.event.ChannelMembersEventData
import com.sceyt.chatuikit.data.managers.channel.event.ChannelOwnerChangedEventData
import com.sceyt.chatuikit.data.managers.channel.event.ChannelUnreadCountUpdatedEventData
import com.sceyt.chatuikit.data.managers.channel.event.MessageMarkerEventData
import com.sceyt.chatuikit.data.managers.connection.ConnectionEventManager
import com.sceyt.chatuikit.data.managers.connection.event.ConnectionStateData
import com.sceyt.chatuikit.data.managers.message.MessageEventManager
import com.sceyt.chatuikit.data.managers.message.event.MessageStatusChangeData
import com.sceyt.chatuikit.data.managers.message.event.ReactionUpdateEventData
import com.sceyt.chatuikit.data.models.LoadKeyData
import com.sceyt.chatuikit.data.models.PaginationResponse
import com.sceyt.chatuikit.data.models.SceytPagingResponse
import com.sceyt.chatuikit.data.models.SceytResponse
import com.sceyt.chatuikit.data.models.SendMessageResult
import com.sceyt.chatuikit.data.models.SyncNearMessagesResult
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.channels.SceytMember
import com.sceyt.chatuikit.data.models.messages.AttachmentWithUserData
import com.sceyt.chatuikit.data.models.messages.FileChecksumData
import com.sceyt.chatuikit.data.models.messages.LinkPreviewDetails
import com.sceyt.chatuikit.data.models.messages.MarkerType
import com.sceyt.chatuikit.data.models.messages.SceytMarker
import com.sceyt.chatuikit.data.models.messages.SceytMessage
import com.sceyt.chatuikit.data.models.messages.SceytReaction
import com.sceyt.chatuikit.data.models.messages.SceytUser
import com.sceyt.chatuikit.koin.SceytKoinComponent
import com.sceyt.chatuikit.persistence.entity.messages.AttachmentPayLoadDb
import com.sceyt.chatuikit.persistence.file_transfer.TransferData
import com.sceyt.chatuikit.persistence.interactor.AttachmentInteractor
import com.sceyt.chatuikit.persistence.interactor.ChannelInteractor
import com.sceyt.chatuikit.persistence.interactor.ChannelMemberInteractor
import com.sceyt.chatuikit.persistence.interactor.MessageInteractor
import com.sceyt.chatuikit.persistence.interactor.MessageMarkerInteractor
import com.sceyt.chatuikit.persistence.interactor.MessageReactionInteractor
import com.sceyt.chatuikit.persistence.interactor.PersistenceMessageMarkerLogic
import com.sceyt.chatuikit.persistence.interactor.UserInteractor
import com.sceyt.chatuikit.persistence.logic.PersistenceAttachmentLogic
import com.sceyt.chatuikit.persistence.logic.PersistenceChannelsLogic
import com.sceyt.chatuikit.persistence.logic.PersistenceConnectionLogic
import com.sceyt.chatuikit.persistence.logic.PersistenceMembersLogic
import com.sceyt.chatuikit.persistence.logic.PersistenceMessagesLogic
import com.sceyt.chatuikit.persistence.logic.PersistenceReactionsLogic
import com.sceyt.chatuikit.persistence.logic.PersistenceUsersLogic
import com.sceyt.chatuikit.presentation.components.channel.input.mention.Mention
import com.sceyt.chatuikit.presentation.components.channel.input.format.BodyStyleRange
import com.sceyt.chatuikit.services.SceytPresenceChecker
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch

internal class PersistenceMiddleWareImpl(private val channelLogic: PersistenceChannelsLogic,
                                         private val messagesLogic: PersistenceMessagesLogic,
                                         private val attachmentsLogic: PersistenceAttachmentLogic,
                                         private val reactionsLogic: PersistenceReactionsLogic,
                                         private val messageMarkerLogic: PersistenceMessageMarkerLogic,
                                         private val membersLogic: PersistenceMembersLogic,
                                         private val usersLogic: PersistenceUsersLogic,
                                         private val connectionLogic: PersistenceConnectionLogic) :
        ChannelMemberInteractor, MessageInteractor, ChannelInteractor,
        UserInteractor, AttachmentInteractor, MessageMarkerInteractor,
        MessageReactionInteractor, SceytKoinComponent {


    private val scope = CoroutineScope(Dispatchers.IO + SupervisorJob())

    init {
        // Channel events
        ChannelEventManager.onChannelEventFlow.onEach(::onChannelEvent).launchIn(scope)
        ChannelEventManager.onTotalUnreadChangedFlow.onEach(::onChannelUnreadCountUpdatedEvent).launchIn(scope)
        ChannelEventManager.onChannelMembersEventFlow.onEach(::onChannelMemberEvent).launchIn(scope)
        ChannelEventManager.onChannelOwnerChangedEventFlow.onEach(::onChannelOwnerChangedEvent).launchIn(scope)
        // Message events
        ChannelEventManager.onMessageStatusFlow.onEach(::onMessageStatusChangeEvent).launchIn(scope)
        ChannelEventManager.onMarkerReceivedFlow.onEach(::onMessageMarkerEvent).launchIn(scope)
        MessageEventManager.onMessageFlow.onEach(::onMessage).launchIn(scope)
        MessageEventManager.onMessageReactionUpdatedFlow.onEach(::onMessageReactionUpdated).launchIn(scope)
        MessageEventManager.onMessageEditedOrDeletedFlow.onEach(::onMessageEditedOrDeleted).launchIn(scope)

        // Connection events
        ConnectionEventManager.onChangedConnectStatusFlow.onEach(::onChangedConnectStatus).launchIn(scope)

        // Presence events
        SceytPresenceChecker.onPresenceCheckUsersFlow.distinctUntilChanged().onEach(::onPresenceChanged).launchIn(scope)
    }


    private fun onChannelEvent(data: ChannelEventData) {
        scope.launch(Dispatchers.IO) { channelLogic.onChannelEvent(data) }
    }

    private fun onChannelUnreadCountUpdatedEvent(data: ChannelUnreadCountUpdatedEventData) {
        scope.launch(Dispatchers.IO) { channelLogic.onChannelUnreadCountUpdatedEvent(data) }
    }

    private fun onChannelMemberEvent(data: ChannelMembersEventData) {
        scope.launch(Dispatchers.IO) { membersLogic.onChannelMemberEvent(data) }
    }

    private fun onChannelOwnerChangedEvent(data: ChannelOwnerChangedEventData) {
        scope.launch(Dispatchers.IO) { membersLogic.onChannelOwnerChangedEvent(data) }
    }

    private fun onMessageStatusChangeEvent(data: MessageStatusChangeData) {
        scope.launch(Dispatchers.IO) { messagesLogic.onMessageStatusChangeEvent(data) }
        scope.launch(Dispatchers.IO) { channelLogic.onMessageStatusChangeEvent(data) }
        scope.launch(Dispatchers.IO) { messageMarkerLogic.onMessageStatusChangeEvent(data) }
    }

    private fun onMessageMarkerEvent(data: MessageMarkerEventData) {
        scope.launch(Dispatchers.IO) { messageMarkerLogic.onMessageMarkerEvent(data) }
    }

    private fun onMessage(data: Pair) {
        scope.launch(Dispatchers.IO) {
            messagesLogic.onMessage(data)
            channelLogic.onMessage(data)
        }
    }

    private fun onMessageReactionUpdated(data: ReactionUpdateEventData) {
        scope.launch(Dispatchers.IO) { reactionsLogic.onMessageReactionUpdated(data) }
    }

    private fun onMessageEditedOrDeleted(sceytMessage: SceytMessage) {
        scope.launch(Dispatchers.IO) { messagesLogic.onMessageEditedOrDeleted(sceytMessage) }
        scope.launch(Dispatchers.IO) { channelLogic.onMessageEditedOrDeleted(sceytMessage) }
    }

    private fun onChangedConnectStatus(data: ConnectionStateData) {
        scope.launch(Dispatchers.IO) { connectionLogic.onChangedConnectStatus(data) }
    }

    private fun onPresenceChanged(users: List) {
        scope.launch(Dispatchers.IO) { usersLogic.onUserPresenceChanged(users) }
        scope.launch(Dispatchers.IO) { channelLogic.onUserPresenceChanged(users) }
    }

    override suspend fun loadChannels(offset: Int, searchQuery: String, loadKey: LoadKeyData?,
                                      ignoreDb: Boolean): Flow> {
        return channelLogic.loadChannels(offset, searchQuery, loadKey, ignoreDb)
    }

    override suspend fun searchChannelsWithUserIds(offset: Int, limit: Int, searchQuery: String, userIds: List,
                                                   includeUserNames: Boolean, loadKey: LoadKeyData?,
                                                   onlyMine: Boolean, ignoreDb: Boolean): Flow> {
        return channelLogic.searchChannelsWithUserIds(offset, limit, searchQuery, userIds, includeUserNames, loadKey, onlyMine, ignoreDb)
    }

    override suspend fun syncChannels(limit: Int): Flow {
        return channelLogic.syncChannels(limit)
    }

    override suspend fun markChannelAsRead(channelId: Long): SceytResponse {
        return channelLogic.markChannelAsRead(channelId)
    }

    override suspend fun markChannelAsUnRead(channelId: Long): SceytResponse {
        return channelLogic.markChannelAsUnRead(channelId)
    }

    override suspend fun clearHistory(channelId: Long, forEveryone: Boolean): SceytResponse {
        return channelLogic.clearHistory(channelId, forEveryone)
    }

    override suspend fun blockAndLeaveChannel(channelId: Long): SceytResponse {
        return channelLogic.blockAndLeaveChannel(channelId)
    }

    override suspend fun deleteChannel(channelId: Long): SceytResponse {
        return channelLogic.deleteChannel(channelId)
    }

    override suspend fun leaveChannel(channelId: Long): SceytResponse {
        return channelLogic.leaveChannel(channelId)
    }

    override suspend fun findOrCreateDirectChannel(user: SceytUser): SceytResponse {
        return channelLogic.findOrCreateDirectChannel(user)
    }

    override suspend fun createChannel(createChannelData: CreateChannelData): SceytResponse {
        return channelLogic.createChannel(createChannelData)
    }

    override suspend fun muteChannel(channelId: Long, muteUntil: Long): SceytResponse {
        return channelLogic.muteChannel(channelId, muteUntil)
    }

    override suspend fun unMuteChannel(channelId: Long): SceytResponse {
        return channelLogic.unMuteChannel(channelId)
    }

    override suspend fun enableAutoDelete(channelId: Long, period: Long): SceytResponse {
        return channelLogic.enableAutoDelete(channelId, period)
    }

    override suspend fun disableAutoDelete(channelId: Long): SceytResponse {
        return channelLogic.disableAutoDelete(channelId)
    }

    override suspend fun pinChannel(channelId: Long): SceytResponse {
        return channelLogic.pinChannel(channelId)
    }

    override suspend fun unpinChannel(channelId: Long): SceytResponse {
        return channelLogic.unpinChannel(channelId)
    }

    override suspend fun getChannelFromDb(channelId: Long): SceytChannel? {
        return channelLogic.getChannelFromDb(channelId)
    }

    override suspend fun getDirectChannelFromDb(peerId: String): SceytChannel? {
        return channelLogic.getDirectChannelFromDb(peerId)
    }

    override suspend fun getChannelFromServer(channelId: Long): SceytResponse {
        return channelLogic.getChannelFromServer(channelId)
    }

    override suspend fun getChannelFromServerByUrl(uri: String): SceytResponse> {
        return channelLogic.getChannelFromServerByUrl(uri)
    }

    override suspend fun getChannelsCountFromDb(): Int {
        return channelLogic.getChannelsCountFromDb()
    }

    override suspend fun editChannel(channelId: Long, data: EditChannelData): SceytResponse {
        return channelLogic.editChannel(channelId, data)
    }

    override suspend fun join(channelId: Long): SceytResponse {
        return channelLogic.join(channelId)
    }

    override suspend fun hideChannel(channelId: Long): SceytResponse {
        return channelLogic.hideChannel(channelId)
    }

    override suspend fun updateDraftMessage(channelId: Long, message: String?, mentionUsers: List,
                                            styling: List?, replyOrEditMessage: SceytMessage?, isReply: Boolean) {
        channelLogic.updateDraftMessage(channelId, message, mentionUsers, styling, replyOrEditMessage, isReply)
    }

    override fun getTotalUnreadCount(): Flow {
        return channelLogic.getTotalUnreadCount()
    }

    override fun loadChannelMembers(channelId: Long, offset: Int, role: String?): Flow> {
        return membersLogic.loadChannelMembers(channelId, offset, role)
    }

    override suspend fun loadChannelMembersByIds(channelId: Long, vararg ids: String): List {
        return membersLogic.loadChannelMembersByIds(channelId, *ids)
    }

    override suspend fun loadChannelMembersByDisplayName(channelId: Long, name: String): List {
        return membersLogic.loadChannelMembersByDisplayName(channelId, name)
    }

    override suspend fun filterOnlyMembersByIds(channelId: Long, ids: List): List {
        return membersLogic.filterOnlyMembersByIds(channelId, ids)
    }

    override suspend fun changeChannelOwner(channelId: Long, newOwnerId: String): SceytResponse {
        return membersLogic.changeChannelOwner(channelId, newOwnerId)
    }

    override suspend fun changeChannelMemberRole(channelId: Long, vararg member: SceytMember): SceytResponse {
        return membersLogic.changeChannelMemberRole(channelId, *member)
    }

    override suspend fun addMembersToChannel(channelId: Long, members: List): SceytResponse {
        return membersLogic.addMembersToChannel(channelId, members)
    }

    override suspend fun blockAndDeleteMember(channelId: Long, memberId: String): SceytResponse {
        return membersLogic.blockAndDeleteMember(channelId, memberId)
    }

    override suspend fun deleteMember(channelId: Long, memberId: String): SceytResponse {
        return membersLogic.deleteMember(channelId, memberId)
    }

    override suspend fun getMembersCountDb(channelId: Long): Int {
        return membersLogic.getMembersCountDb(channelId)
    }

    override suspend fun loadPrevMessages(conversationId: Long, lastMessageId: Long, replyInThread: Boolean, offset: Int,
                                          limit: Int, loadKey: LoadKeyData, ignoreDb: Boolean): Flow> {
        return messagesLogic.loadPrevMessages(conversationId, lastMessageId, replyInThread, offset, limit, loadKey, ignoreDb)
    }

    override suspend fun loadNextMessages(conversationId: Long, lastMessageId: Long, replyInThread: Boolean,
                                          offset: Int, limit: Int, ignoreDb: Boolean): Flow> {
        return messagesLogic.loadNextMessages(conversationId, lastMessageId, replyInThread, offset, limit, ignoreDb)
    }

    override suspend fun loadNearMessages(conversationId: Long, messageId: Long, replyInThread: Boolean,
                                          limit: Int, loadKey: LoadKeyData, ignoreDb: Boolean, ignoreServer: Boolean): Flow> {
        return messagesLogic.loadNearMessages(conversationId, messageId, replyInThread, limit, loadKey, ignoreDb, ignoreServer)
    }

    override suspend fun loadNewestMessages(conversationId: Long, replyInThread: Boolean, limit: Int,
                                            loadKey: LoadKeyData, ignoreDb: Boolean): Flow> {
        return messagesLogic.loadNewestMessages(conversationId, replyInThread, limit, loadKey, ignoreDb)
    }

    override suspend fun searchMessages(conversationId: Long, replyInThread: Boolean,
                                        query: String): SceytPagingResponse> {
        return messagesLogic.searchMessages(conversationId, replyInThread, query)
    }

    override suspend fun loadNextSearchMessages(): SceytPagingResponse> {
        return messagesLogic.loadNextSearchMessages()
    }

    override suspend fun loadMessagesById(conversationId: Long, ids: List): SceytResponse> {
        return messagesLogic.loadMessagesById(conversationId, ids)
    }

    override suspend fun syncMessagesAfterMessageId(conversationId: Long, replyInThread: Boolean,
                                                    messageId: Long): Flow>> {
        return messagesLogic.syncMessagesAfterMessageId(conversationId, replyInThread, messageId)
    }

    override suspend fun syncNearMessages(conversationId: Long, messageId: Long, replyInThread: Boolean): SyncNearMessagesResult {
        return messagesLogic.syncNearMessages(conversationId, messageId, replyInThread)
    }

    override suspend fun sendMessageAsFlow(channelId: Long, message: Message): Flow {
        return messagesLogic.sendMessageAsFlow(channelId, message)
    }

    override suspend fun sendMessage(channelId: Long, message: Message) {
        return messagesLogic.sendMessage(channelId, message)
    }

    override suspend fun sendMessages(channelId: Long, messages: List) {
        return messagesLogic.sendMessages(channelId, messages)
    }

    override suspend fun sendSharedFileMessage(channelId: Long, message: Message) {
        return messagesLogic.sendSharedFileMessage(channelId, message)
    }

    override suspend fun sendFrowardMessages(channelId: Long, vararg messagesToSend: Message): SceytResponse {
        return messagesLogic.sendFrowardMessages(channelId, *messagesToSend)
    }

    override suspend fun sendMessageWithUploadedAttachments(channelId: Long, message: Message): SceytResponse {
        return messagesLogic.sendMessageWithUploadedAttachments(channelId, message)
    }

    override suspend fun sendPendingMessages(channelId: Long) {
        messagesLogic.sendPendingMessages(channelId)
    }

    override suspend fun sendAllPendingMessages() {
        messagesLogic.sendAllPendingMessages()
    }

    override suspend fun sendAllPendingMarkers() {
        messagesLogic.sendAllPendingMarkers()
    }

    override suspend fun sendAllPendingMessageStateUpdates() {
        messagesLogic.sendAllPendingMessageStateUpdates()
    }

    override suspend fun sendAllPendingReactions() {
        reactionsLogic.sendAllPendingReactions()
    }

    override suspend fun markMessagesAs(channelId: Long, marker: MarkerType,
                                        vararg ids: Long): List> {
        return messagesLogic.markMessagesAs(channelId, marker, *ids)
    }

    override suspend fun addMessagesMarker(channelId: Long, marker: String, vararg ids: Long): List> {
        return messagesLogic.addMessagesMarker(channelId, marker, *ids)
    }

    override suspend fun editMessage(channelId: Long, message: SceytMessage): SceytResponse {
        return messagesLogic.editMessage(channelId, message)
    }

    override suspend fun deleteMessage(channelId: Long, message: SceytMessage,
                                       deleteType: DeleteMessageType): SceytResponse {
        return messagesLogic.deleteMessage(channelId, message, deleteType)
    }

    override suspend fun getMessageFromServerById(channelId: Long, messageId: Long): SceytResponse {
        return messagesLogic.getMessageFromServerById(channelId, messageId)
    }

    override suspend fun getMessageDbById(messageId: Long): SceytMessage? {
        return messagesLogic.getMessageDbById(messageId)
    }

    override suspend fun getMessageDbByTid(messageTid: Long): SceytMessage? {
        return messagesLogic.getMessageDbByTid(messageTid)
    }

    override suspend fun sendTyping(channelId: Long, typing: Boolean) {
        messagesLogic.sendTyping(channelId, typing)
    }

    override fun getOnMessageFlow(): SharedFlow> = messagesLogic.getOnMessageFlow()

    override suspend fun getAllPayLoadsByMsgTid(tid: Long): List {
        return attachmentsLogic.getAllPayLoadsByMsgTid(tid)
    }

    override suspend fun getPrevAttachments(conversationId: Long, lastAttachmentId: Long,
                                            types: List, offset: Int, ignoreDb: Boolean,
                                            loadKeyData: LoadKeyData): Flow> {
        return attachmentsLogic.getPrevAttachments(conversationId, lastAttachmentId, types, offset, ignoreDb, loadKeyData)
    }

    override suspend fun getNextAttachments(conversationId: Long, lastAttachmentId: Long,
                                            types: List, offset: Int, ignoreDb: Boolean,
                                            loadKeyData: LoadKeyData): Flow> {
        return attachmentsLogic.getNextAttachments(conversationId, lastAttachmentId, types, offset, ignoreDb, loadKeyData)
    }

    override suspend fun getNearAttachments(conversationId: Long, attachmentId: Long,
                                            types: List, offset: Int, ignoreDb: Boolean,
                                            loadKeyData: LoadKeyData): Flow> {
        return attachmentsLogic.getNearAttachments(conversationId, attachmentId, types, offset, ignoreDb, loadKeyData)
    }

    override suspend fun updateAttachmentIdAndMessageId(message: SceytMessage) {
        attachmentsLogic.updateAttachmentIdAndMessageId(message)
    }

    override suspend fun updateTransferDataByMsgTid(data: TransferData) {
        attachmentsLogic.updateTransferDataByMsgTid(data)
    }

    override suspend fun updateAttachmentWithTransferData(data: TransferData) {
        attachmentsLogic.updateAttachmentWithTransferData(data)
    }

    override suspend fun updateAttachmentFilePathAndMetadata(messageTid: Long, newPath: String,
                                                             fileSize: Long, metadata: String?) {
        attachmentsLogic.updateAttachmentFilePathAndMetadata(messageTid, newPath, fileSize, metadata)
    }

    override suspend fun getFileChecksumData(filePath: String?): FileChecksumData? {
        return attachmentsLogic.getFileChecksumData(filePath)
    }

    override suspend fun getLinkPreviewData(link: String?): SceytResponse {
        return attachmentsLogic.getLinkPreviewData(link)
    }

    override suspend fun upsertLinkPreviewData(linkDetails: LinkPreviewDetails) {
        attachmentsLogic.upsertLinkPreviewData(linkDetails)
    }

    override suspend fun loadUsers(query: String): SceytResponse> {
        return usersLogic.loadUsers(query)
    }

    override suspend fun loadMoreUsers(): SceytResponse> {
        return usersLogic.loadMoreUsers()
    }

    override suspend fun getUsersByIds(ids: List): SceytResponse> {
        return usersLogic.getSceytUsers(ids)
    }

    override suspend fun getUserDbById(id: String): SceytUser? {
        return usersLogic.getUserDbById(id)
    }

    override suspend fun getUsersDbByIds(id: List): List {
        return usersLogic.getUsersDbByIds(id)
    }

    override suspend fun getCurrentUser(): SceytUser? {
        return usersLogic.getCurrentUser()
    }

    override fun getCurrentUserNonSuspend(): SceytUser? {
        return usersLogic.getCurrentUserNonSuspend()
    }

    override fun getCurrentUserAsFlow(): Flow {
        return usersLogic.getCurrentUserAsFlow()
    }

    override suspend fun uploadAvatar(avatarUrl: String): SceytResponse {
        return usersLogic.uploadAvatar(avatarUrl)
    }

    override suspend fun updateProfile(firsName: String?, lastName: String?,
                                       avatarUrl: String?,
                                       metadataMap: Map?): SceytResponse {
        return usersLogic.updateProfile(firsName, lastName, avatarUrl, metadataMap)
    }

    override suspend fun setPresenceState(presenceState: PresenceState): SceytResponse {
        return usersLogic.setPresenceState(presenceState)
    }

    override suspend fun updateStatus(status: String): SceytResponse {
        return usersLogic.updateStatus(status)
    }

    override suspend fun getSettings(): SceytResponse {
        return usersLogic.getSettings()
    }

    override suspend fun muteNotifications(muteUntil: Long): SceytResponse {
        return usersLogic.muteNotifications(muteUntil)
    }

    override suspend fun unMuteNotifications(): SceytResponse {
        return usersLogic.unMuteNotifications()
    }

    override suspend fun blockUnBlockUser(userId: String, block: Boolean): SceytResponse> {
        return usersLogic.blockUnBlockUser(userId, block)
    }

    override suspend fun loadReactions(messageId: Long, offset: Int, key: String,
                                       loadKey: LoadKeyData?, ignoreDb: Boolean): Flow> {
        return reactionsLogic.loadReactions(messageId, offset, key, loadKey, ignoreDb)
    }

    override suspend fun getMessageReactionsDbByKey(messageId: Long, key: String): List {
        return reactionsLogic.getMessageReactionsDbByKey(messageId, key)
    }

    override suspend fun addReaction(channelId: Long, messageId: Long, key: String, score: Int,
                                     reason: String, enforceUnique: Boolean): SceytResponse {
        return reactionsLogic.addReaction(channelId, messageId, key, score, reason, enforceUnique)
    }

    override suspend fun deleteReaction(channelId: Long, messageId: Long, scoreKey: String): SceytResponse {
        return reactionsLogic.deleteReaction(channelId, messageId, scoreKey)
    }

    override suspend fun getMessageMarkers(messageId: Long, name: String, offset: Int, limit: Int): SceytResponse> {
        return messageMarkerLogic.getMessageMarkers(messageId, name, offset, limit)
    }

    override suspend fun getMessageMarkersDb(messageId: Long, names: List, offset: Int, limit: Int): List {
        return messageMarkerLogic.getMessageMarkersDb(messageId, names, offset, limit)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy