Fixed leave group not hiding send message area

This commit is contained in:
Sylvain Berfini 2024-01-23 11:29:25 +01:00
parent ef47624b9d
commit 6f8469eb0b
2 changed files with 8 additions and 6 deletions

View file

@ -129,6 +129,7 @@ class ConversationInfoFragment : SlidingPaneChildFragment() {
viewModel.groupLeftEvent.observe(viewLifecycleOwner) {
it.consume {
Log.i("$TAG Group has been left, leaving conversation info...")
sharedViewModel.forceRefreshConversationInfo.value = Event(true)
goBack()
val message = getString(R.string.toast_group_conversation_left)
(requireActivity() as MainActivity).showGreenToast(

View file

@ -505,12 +505,6 @@ class ConversationViewModel @UiThread constructor() : ViewModel() {
scrollingPosition = SCROLLING_POSITION_NOT_SET
computeComposingLabel()
val empty = chatRoom.hasCapability(ChatRoom.Capabilities.Conference.toInt()) && chatRoom.participants.isEmpty()
val readOnly = chatRoom.isReadOnly || empty
isReadOnly.postValue(readOnly)
if (readOnly) {
Log.w("$TAG Conversation with subject [${chatRoom.subject}] is read only!")
}
isEndToEndEncrypted.postValue(
chatRoom.hasCapability(ChatRoom.Capabilities.Encrypted.toInt())
)
@ -529,6 +523,13 @@ class ConversationViewModel @UiThread constructor() : ViewModel() {
val group = LinphoneUtils.isChatRoomAGroup(chatRoom)
isGroup.postValue(group)
val empty = chatRoom.hasCapability(ChatRoom.Capabilities.Conference.toInt()) && chatRoom.participants.isEmpty()
val readOnly = chatRoom.isReadOnly || empty
isReadOnly.postValue(readOnly)
if (readOnly) {
Log.w("$TAG Conversation with subject [${chatRoom.subject}] is read only!")
}
subject.postValue(chatRoom.subject)
val friends = arrayListOf<Friend>()