Prevent 1-1 events for conference joined/left + temporary read only state

This commit is contained in:
Sylvain Berfini 2025-05-16 15:51:28 +02:00
parent 81d0da4241
commit 25d13f44c7
2 changed files with 8 additions and 4 deletions

View file

@ -115,7 +115,7 @@ class ConversationModel
@WorkerThread
override fun onConferenceLeft(chatRoom: ChatRoom, eventLog: EventLog) {
Log.w("TAG Conversation has been left")
isReadOnly.postValue(true)
isReadOnly.postValue(chatRoom.isReadOnly)
}
@WorkerThread

View file

@ -153,7 +153,9 @@ class ConversationViewModel
@WorkerThread
override fun onConferenceJoined(chatRoom: ChatRoom, eventLog: EventLog) {
Log.i("$TAG Conversation was joined")
addEvents(arrayOf(eventLog))
if (LinphoneUtils.isChatRoomAGroup(chatRoom)) {
addEvents(arrayOf(eventLog))
}
computeConversationInfo()
val messageToForward = pendingForwardMessage
@ -167,8 +169,10 @@ class ConversationViewModel
@WorkerThread
override fun onConferenceLeft(chatRoom: ChatRoom, eventLog: EventLog) {
Log.w("$TAG Conversation was left")
addEvents(arrayOf(eventLog))
isReadOnly.postValue(true)
if (LinphoneUtils.isChatRoomAGroup(chatRoom)) {
addEvents(arrayOf(eventLog))
}
isReadOnly.postValue(chatRoom.isReadOnly)
}
@WorkerThread