handle reaction message for lookIntoFuture
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Родитель
15d54f745b
Коммит
aa76636f72
|
@ -827,14 +827,12 @@ class ChatActivity :
|
|||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
||||
this.lifecycleScope.launch {
|
||||
chatViewModel.getUpdateMessageFlow
|
||||
.onEach { pair ->
|
||||
val lookIntoFuture = pair.first
|
||||
var chatMessageList = pair.second
|
||||
|
||||
adapter!!.update(chatMessageList[0])
|
||||
.onEach {
|
||||
updateAdapterForReaction(it)
|
||||
}
|
||||
.collect()
|
||||
}
|
||||
|
|
|
@ -30,13 +30,7 @@ interface ChatMessageRepository : LifecycleAwareManager {
|
|||
>
|
||||
>
|
||||
|
||||
val updateMessageFlow:
|
||||
Flow<
|
||||
Pair<
|
||||
Boolean,
|
||||
List<ChatMessage>
|
||||
>
|
||||
>
|
||||
val updateMessageFlow: Flow<ChatMessage>
|
||||
|
||||
fun setData(
|
||||
conversationModel: ConversationModel,
|
||||
|
|
|
@ -66,21 +66,11 @@ class OfflineFirstChatRepository @Inject constructor(
|
|||
> = MutableSharedFlow()
|
||||
|
||||
override val updateMessageFlow:
|
||||
Flow<
|
||||
Pair<
|
||||
Boolean,
|
||||
List<ChatMessage>
|
||||
>
|
||||
>
|
||||
Flow<ChatMessage>
|
||||
get() = _updateMessageFlow
|
||||
|
||||
private val _updateMessageFlow:
|
||||
MutableSharedFlow<
|
||||
Pair<
|
||||
Boolean,
|
||||
List<ChatMessage>
|
||||
>
|
||||
> = MutableSharedFlow()
|
||||
MutableSharedFlow<ChatMessage> = MutableSharedFlow()
|
||||
|
||||
private var newXChatLastCommonRead: Int? = null
|
||||
private var itIsPaused = false
|
||||
|
@ -480,10 +470,7 @@ class OfflineFirstChatRepository @Inject constructor(
|
|||
messageJson.parentMessage?.let { parentMessageJson ->
|
||||
val parentMessageEntity = parentMessageJson.asEntity(currentUser.id!!)
|
||||
chatDao.upsertChatMessage(parentMessageEntity)
|
||||
// TODO: inform UI to update this message!!
|
||||
|
||||
val pair = Pair(true, listOf(parentMessageEntity.asModel()))
|
||||
_updateMessageFlow.emit(pair)
|
||||
_updateMessageFlow.emit(parentMessageEntity.asModel())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче