mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent replying & transfering messages to read only or disabled conversations
This commit is contained in:
parent
1697dc7f7b
commit
d77f51a5e2
1 changed files with 11 additions and 1 deletions
|
|
@ -304,6 +304,10 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
Log.e("$TAG Swipe viewHolder index [$index] is out of bounds!")
|
||||
} else {
|
||||
adapter.notifyItemChanged(index)
|
||||
if (viewModel.isReadOnly.value == true || viewModel.isDisabledBecauseNotSecured.value == true) {
|
||||
Log.w("$TAG Do not handle swipe action because conversation is read only")
|
||||
return@RecyclerViewSwipeUtilsCallback
|
||||
}
|
||||
|
||||
val chatMessageEventLog = adapter.currentList[index]
|
||||
val chatMessageModel = (chatMessageEventLog.model as? MessageModel)
|
||||
|
|
@ -344,7 +348,13 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
sharedViewModel.messageToForwardEvent.observe(viewLifecycleOwner) { event ->
|
||||
event.consume { toForward ->
|
||||
Log.i("$TAG Found message to forward")
|
||||
sendMessageViewModel.forwardMessage(toForward)
|
||||
if (viewModel.isReadOnly.value == true || viewModel.isDisabledBecauseNotSecured.value == true) {
|
||||
Log.w(
|
||||
"$TAG Can't forward message in this conversation as it is read only"
|
||||
)
|
||||
} else {
|
||||
sendMessageViewModel.forwardMessage(toForward)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue