mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-26 00:08:11 +00:00
Do not send meeting message invitation when chat is disabled
This commit is contained in:
parent
50bd8f67d5
commit
9ce803667b
4 changed files with 12 additions and 4 deletions
|
|
@ -24,6 +24,7 @@ import androidx.annotation.WorkerThread
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import java.util.TimeZone
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.core.Address
|
||||
import org.linphone.core.ConferenceInfo
|
||||
import org.linphone.core.ConferenceScheduler
|
||||
|
|
@ -93,7 +94,7 @@ class MeetingViewModel
|
|||
"$TAG Conference ${conferenceScheduler.info?.subject} cancelled"
|
||||
)
|
||||
val params = LinphoneUtils.getChatRoomParamsToCancelMeeting()
|
||||
if (params != null) {
|
||||
if (params != null && !corePreferences.disableChat) {
|
||||
conferenceScheduler.sendInvitations(params)
|
||||
} else {
|
||||
operationInProgress.postValue(false)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import androidx.annotation.UiThread
|
|||
import androidx.annotation.WorkerThread
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.core.Account
|
||||
import org.linphone.core.AccountListenerStub
|
||||
import org.linphone.core.Address
|
||||
|
|
@ -88,7 +89,7 @@ class MeetingsListViewModel
|
|||
"$TAG Conference ${conferenceScheduler.info?.subject} cancelled"
|
||||
)
|
||||
val params = LinphoneUtils.getChatRoomParamsToCancelMeeting()
|
||||
if (params != null) {
|
||||
if (params != null && !corePreferences.disableChat) {
|
||||
conferenceScheduler.sendInvitations(params)
|
||||
} else {
|
||||
operationInProgress.postValue(false)
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ class ScheduleMeetingViewModel
|
|||
|
||||
val hideBroadcast = MutableLiveData<Boolean>()
|
||||
|
||||
val chatDisabled = MutableLiveData<Boolean>()
|
||||
|
||||
val conferenceCreatedEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
|
@ -125,7 +127,7 @@ class ScheduleMeetingViewModel
|
|||
)
|
||||
}
|
||||
|
||||
if (sendInvitations.value == true) {
|
||||
if (sendInvitations.value == true && !corePreferences.disableChat) {
|
||||
Log.i("$TAG User asked for invitations to be sent, let's do it")
|
||||
|
||||
val chatRoomParams = coreContext.core.createConferenceParams(null)
|
||||
|
|
@ -178,10 +180,11 @@ class ScheduleMeetingViewModel
|
|||
init {
|
||||
coreContext.postOnCoreThread {
|
||||
hideBroadcast.postValue(corePreferences.disableBroadcasts)
|
||||
chatDisabled.postValue(corePreferences.disableChat)
|
||||
sendInvitations.postValue(!corePreferences.disableChat)
|
||||
}
|
||||
isBroadcastSelected.value = false
|
||||
showBroadcastHelp.value = false
|
||||
sendInvitations.value = true
|
||||
|
||||
selectedTimeZone.value = availableTimeZones.find {
|
||||
it.id == TimeZone.getDefault().id
|
||||
|
|
|
|||
|
|
@ -514,6 +514,8 @@
|
|||
android:layout_marginEnd="16dp"
|
||||
android:textColor="@color/gray_main2_600"
|
||||
android:textSize="14sp"
|
||||
android:visibility="@{viewModel.chatDisabled ? View.GONE : View.VISIBLE}"
|
||||
android:enabled="@{!viewModel.chatDisabled}"
|
||||
android:checked="@={viewModel.sendInvitations}"
|
||||
app:layout_constraintTop_toBottomOf="@id/separator_5"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
|
@ -524,6 +526,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:visibility="@{viewModel.chatDisabled ? View.GONE : View.VISIBLE}"
|
||||
android:text="@string/meeting_schedule_send_invitations_title"
|
||||
app:layout_constraintStart_toEndOf="@id/send_invitations"
|
||||
app:layout_constraintTop_toTopOf="@id/send_invitations"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue