KBase Chat Merging Dispatcher
abstract class KBaseChatMergingDispatcher(val assummerId: String = "", val _state: MediatorLiveData<KBaseChatListViewModel.State>, val _draftState: LiveData<List<KChatDraft>>?, val _paginationState: MediatorLiveData<KBaseChatListViewModel.PaginationState>?, val _chatItemChangedState: MutableLiveData<KChatListItem>?) : IChatMergingDispatcher
会话合并转发相关基础功能实现
Inheritors
Constructors
Link copied to clipboard
constructor(assummerId: String = "", _state: MediatorLiveData<KBaseChatListViewModel.State>, _draftState: LiveData<List<KChatDraft>>?, _paginationState: MediatorLiveData<KBaseChatListViewModel.PaginationState>?, _chatItemChangedState: MutableLiveData<KChatListItem>?)
Properties
Functions
Link copied to clipboard
Link copied to clipboard
筛选出消息盒子
Link copied to clipboard
fun filterKIMCoreChatFromItemToMap(chats: Collection<KChatListItem>): MutableMap<String, KIMCoreChat>
筛选出BaseChatItem和BaseBoxItem两种类型的会话数据
Link copied to clipboard
fun filterTargetBoxList(allChats: Collection<KIMCoreChat>, targetBoxTypes: Set<Int>): MutableList<KIMCoreBox>
Link copied to clipboard
查找本地最大的会话seq
Link copied to clipboard
三方拓展会话
Link copied to clipboard
Link copied to clipboard
fun mergeComingChats(comingChats: List<KIMCoreChat>, currAllChatsMap: MutableMap<String, KIMCoreChat>, comingSignalTime: Pair<String, Long>, currSignalTime: Pair<String, Long>?)
根据signalTime决定数据的合并方式,用于解决新旧数据覆盖问题;
Link copied to clipboard
fun mergeList(chatList: List<KIMCoreChat>, boxList: List<KIMCoreBox>, extList: List<KExtChatItem>? = null): MutableList<KChatListItem>
合并KIMCoreChat、KIMCoreBox和KExtChatItem三种会话数据,创建适用于会话列表的KChatListItem
Link copied to clipboard
Link copied to clipboard
open override fun onMergeChats(pagingFrom: String, comingChatList: List<KIMCoreChat>, countDownLatch: CountDownLatch, signalTime: Pair<String, Long>)
将comingChatList列表合并到总会话列表
Link copied to clipboard
处理加载异常
Link copied to clipboard
open override fun onPostPreLoadedFirstPage(comingChatList: List<KIMCoreChat>, signalTime: Pair<String, Long>)
预加载的首页会话上屏处理
Link copied to clipboard
处理重新加载某个会话
Link copied to clipboard
open override fun onRemoveChat(countDownLatch: CountDownLatch, chatIdToRemove: String, signalTime: Pair<String, Long>)
从会话列表中删除会话
Link copied to clipboard
Link copied to clipboard
重排序
Link copied to clipboard
fun setPaginationState(reducer: KBaseChatListViewModel.PaginationState.() -> KBaseChatListViewModel.PaginationState)
分页状态更新
Link copied to clipboard
fun setState(delayMs: Long, reducer: KBaseChatListViewModel.State.() -> KBaseChatListViewModel.State)
会话列表更新
Link copied to clipboard
根据会话折叠功能开关,决定是否过滤掉置顶会话
Link copied to clipboard
更新本地数据