mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
handle reaction message for lookIntoFuture
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
15d54f745b
commit
aa76636f72
@ -827,14 +827,12 @@ class ChatActivity :
|
|||||||
adapter?.notifyDataSetChanged()
|
adapter?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
.collect()
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lifecycleScope.launch {
|
||||||
chatViewModel.getUpdateMessageFlow
|
chatViewModel.getUpdateMessageFlow
|
||||||
.onEach { pair ->
|
.onEach {
|
||||||
val lookIntoFuture = pair.first
|
updateAdapterForReaction(it)
|
||||||
var chatMessageList = pair.second
|
|
||||||
|
|
||||||
adapter!!.update(chatMessageList[0])
|
|
||||||
}
|
}
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
@ -30,13 +30,7 @@ interface ChatMessageRepository : LifecycleAwareManager {
|
|||||||
>
|
>
|
||||||
>
|
>
|
||||||
|
|
||||||
val updateMessageFlow:
|
val updateMessageFlow: Flow<ChatMessage>
|
||||||
Flow<
|
|
||||||
Pair<
|
|
||||||
Boolean,
|
|
||||||
List<ChatMessage>
|
|
||||||
>
|
|
||||||
>
|
|
||||||
|
|
||||||
fun setData(
|
fun setData(
|
||||||
conversationModel: ConversationModel,
|
conversationModel: ConversationModel,
|
||||||
|
@ -66,21 +66,11 @@ class OfflineFirstChatRepository @Inject constructor(
|
|||||||
> = MutableSharedFlow()
|
> = MutableSharedFlow()
|
||||||
|
|
||||||
override val updateMessageFlow:
|
override val updateMessageFlow:
|
||||||
Flow<
|
Flow<ChatMessage>
|
||||||
Pair<
|
|
||||||
Boolean,
|
|
||||||
List<ChatMessage>
|
|
||||||
>
|
|
||||||
>
|
|
||||||
get() = _updateMessageFlow
|
get() = _updateMessageFlow
|
||||||
|
|
||||||
private val _updateMessageFlow:
|
private val _updateMessageFlow:
|
||||||
MutableSharedFlow<
|
MutableSharedFlow<ChatMessage> = MutableSharedFlow()
|
||||||
Pair<
|
|
||||||
Boolean,
|
|
||||||
List<ChatMessage>
|
|
||||||
>
|
|
||||||
> = MutableSharedFlow()
|
|
||||||
|
|
||||||
private var newXChatLastCommonRead: Int? = null
|
private var newXChatLastCommonRead: Int? = null
|
||||||
private var itIsPaused = false
|
private var itIsPaused = false
|
||||||
@ -480,10 +470,7 @@ class OfflineFirstChatRepository @Inject constructor(
|
|||||||
messageJson.parentMessage?.let { parentMessageJson ->
|
messageJson.parentMessage?.let { parentMessageJson ->
|
||||||
val parentMessageEntity = parentMessageJson.asEntity(currentUser.id!!)
|
val parentMessageEntity = parentMessageJson.asEntity(currentUser.id!!)
|
||||||
chatDao.upsertChatMessage(parentMessageEntity)
|
chatDao.upsertChatMessage(parentMessageEntity)
|
||||||
// TODO: inform UI to update this message!!
|
_updateMessageFlow.emit(parentMessageEntity.asModel())
|
||||||
|
|
||||||
val pair = Pair(true, listOf(parentMessageEntity.asModel()))
|
|
||||||
_updateMessageFlow.emit(pair)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user