mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Update chat rooms list when a message is deleted in a conversation
This commit is contained in:
parent
fcf2ffa39c
commit
af8071bf0e
6 changed files with 31 additions and 1 deletions
|
|
@ -621,6 +621,15 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
viewModel.messageDeletedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
val message = getString(R.string.conversation_message_deleted_toast)
|
||||
val icon = R.drawable.x
|
||||
(requireActivity() as MainActivity).showGreenToast(message, icon)
|
||||
sharedViewModel.forceRefreshConversations.value = Event(true)
|
||||
}
|
||||
}
|
||||
|
||||
sharedViewModel.richContentUri.observe(
|
||||
viewLifecycleOwner
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -278,6 +278,12 @@ class ConversationsListFragment : AbstractTopBarFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
sharedViewModel.forceRefreshConversations.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
listViewModel.filter()
|
||||
}
|
||||
}
|
||||
|
||||
// TopBarFragment related
|
||||
|
||||
setViewModelAndTitle(
|
||||
|
|
|
|||
|
|
@ -113,6 +113,10 @@ class ConversationViewModel @UiThread constructor() : AbstractConversationViewMo
|
|||
MutableLiveData<Event<Pair<String, Int>>>()
|
||||
}
|
||||
|
||||
val messageDeletedEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
private var eventsList = arrayListOf<EventLogModel>()
|
||||
|
||||
private val chatRoomListener = object : ChatRoomListenerStub() {
|
||||
|
|
@ -370,6 +374,7 @@ class ConversationViewModel @UiThread constructor() : AbstractConversationViewMo
|
|||
|
||||
Log.i("$TAG Deleting message id [${chatMessageModel.id}]")
|
||||
chatRoom.deleteMessage(chatMessageModel.chatMessage)
|
||||
messageDeletedEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,6 +117,10 @@ class SharedMainViewModel @UiThread constructor() : ViewModel() {
|
|||
MutableLiveData<Event<Bundle>>()
|
||||
}
|
||||
|
||||
val forceRefreshConversations: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
val forceRefreshConversationInfo: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -412,6 +412,7 @@
|
|||
<string name="conversation_dialog_edit_subject">Renommer la conversation</string>
|
||||
<string name="conversation_dialog_subject_hint">Nom de la conversation</string>
|
||||
<string name="conversation_dialog_edit_subject_confirm_button">Confirmer</string>
|
||||
<string name="conversation_message_deleted_toast">Le message a été supprimé</string>
|
||||
|
||||
<string name="conversation_info_participants_list_title">Membres du groupe</string>
|
||||
<string name="conversation_info_add_participants_label">Ajouter des membres</string>
|
||||
|
|
@ -582,7 +583,9 @@
|
|||
<string name="call_zrtp_sas_validation_skip"><u>Passer</u></string>
|
||||
|
||||
<!-- Keep <i></i> in following strings translations! -->
|
||||
<string name="message_meeting_invitation_content_description"><i>invitation à une réunion: </i>%s</string>
|
||||
<string name="message_meeting_invitation_content_description"><i>invitation à une réunion : </i>%s</string>
|
||||
<string name="message_meeting_invitation_updated_content_description"><i>réunion mise à jour : </i>%s</string>
|
||||
<string name="message_meeting_invitation_cancelled_content_description"><i>réunion annulée : </i>%s</string>
|
||||
<string name="message_voice_message_content_description"><i>message vocal</i></string>
|
||||
|
||||
<string name="content_description_trusted_contact_icon">Contact is trusted</string>
|
||||
|
|
|
|||
|
|
@ -460,6 +460,7 @@
|
|||
<string name="conversation_dialog_edit_subject">Edit conversation subject</string>
|
||||
<string name="conversation_dialog_subject_hint">Conversation subject</string>
|
||||
<string name="conversation_dialog_edit_subject_confirm_button">Confirm</string>
|
||||
<string name="conversation_message_deleted_toast">Message has been deleted</string>
|
||||
|
||||
<string name="conversation_info_participants_list_title">Group members</string>
|
||||
<string name="conversation_info_add_participants_label">Add participants</string>
|
||||
|
|
@ -637,6 +638,8 @@
|
|||
|
||||
<!-- Keep <i></i> in following strings translations! -->
|
||||
<string name="message_meeting_invitation_content_description"><i>meeting invite: </i>%s</string>
|
||||
<string name="message_meeting_invitation_updated_content_description"><i>meeting updated: </i>%s</string>
|
||||
<string name="message_meeting_invitation_cancelled_content_description"><i>meeting cancelled: </i>%s</string>
|
||||
<string name="message_voice_message_content_description"><i>voice message</i></string>
|
||||
|
||||
<!-- Content description for accessibility -->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue