Fixed UI not updated when kicked out group conversation

This commit is contained in:
Sylvain Berfini 2024-11-04 15:25:46 +01:00
parent 5f6c02e2ca
commit 807a36b54c
2 changed files with 14 additions and 0 deletions

View file

@ -109,6 +109,12 @@ class ConversationModel @WorkerThread constructor(val chatRoom: ChatRoom) {
computeParticipants()
}
@WorkerThread
override fun onConferenceLeft(chatRoom: ChatRoom, eventLog: EventLog) {
Log.w("TAG Conversation has been left")
isReadOnly.postValue(true)
}
@WorkerThread
override fun onIsComposingReceived(
chatRoom: ChatRoom,

View file

@ -140,6 +140,7 @@ class ConversationViewModel @UiThread constructor() : AbstractConversationViewMo
@WorkerThread
override fun onConferenceJoined(chatRoom: ChatRoom, eventLog: EventLog) {
Log.i("$TAG Conversation was joined")
addEvents(arrayOf(eventLog))
computeConversationInfo()
val messageToForward = pendingForwardMessage
@ -150,6 +151,13 @@ class ConversationViewModel @UiThread constructor() : AbstractConversationViewMo
}
}
@WorkerThread
override fun onConferenceLeft(chatRoom: ChatRoom, eventLog: EventLog) {
Log.w("$TAG Conversation was left")
addEvents(arrayOf(eventLog))
isReadOnly.postValue(true)
}
@WorkerThread
override fun onChatRoomRead(chatRoom: ChatRoom) {
unreadMessagesCount.postValue(0)