mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 04:55:29 +03:00
handle reaction message for lookIntoFuture
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
15d54f745b
commit
aa76636f72
3 changed files with 8 additions and 29 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue