mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-04 13:07:31 +01:00
VoIP: clean code for call transfer and disable it for now
This commit is contained in:
parent
439ea42b54
commit
d87beff434
@ -39,7 +39,7 @@ data class MatrixConfiguration(
|
||||
/**
|
||||
* True to advertise support for call transfers to other parties on Matrix calls.
|
||||
*/
|
||||
val supportsCallTransfer: Boolean = true
|
||||
val supportsCallTransfer: Boolean = false
|
||||
) {
|
||||
|
||||
/**
|
||||
|
@ -43,7 +43,7 @@ data class CallAnswerContent(
|
||||
/**
|
||||
* Capability advertisement.
|
||||
*/
|
||||
@Json(name= "capabilities") val capabilities: CallCapabilities? = null
|
||||
@Json(name = "capabilities") val capabilities: CallCapabilities? = null
|
||||
): CallSignallingContent {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020 New Vector Ltd
|
||||
* Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -53,7 +53,7 @@ data class CallInviteContent(
|
||||
/**
|
||||
* Capability advertisement.
|
||||
*/
|
||||
@Json(name= "capabilities") val capabilities: CallCapabilities? = null
|
||||
@Json(name = "capabilities") val capabilities: CallCapabilities? = null
|
||||
|
||||
): CallSignallingContent {
|
||||
@JsonClass(generateAdapter = true)
|
||||
|
@ -38,7 +38,8 @@ data class CallReplacesContent(
|
||||
*/
|
||||
@Json(name = "replacement_id") val replacementId: String? = null,
|
||||
/**
|
||||
* Optional. If specified, the transferee client waits for an invite to this room and joins it (possibly waiting for user confirmation) and then continues the transfer in this room.
|
||||
* Optional. If specified, the transferee client waits for an invite to this room and joins it
|
||||
* (possibly waiting for user confirmation) and then continues the transfer in this room.
|
||||
* If absent, the transferee contacts the Matrix User ID given in the target_user field in a room of its choosing.
|
||||
*/
|
||||
@Json(name = "target_room") val targerRoomId: String? = null,
|
||||
|
@ -127,7 +127,6 @@ abstract class VectorBaseActivity<VB: ViewBinding> : AppCompatActivity(), HasScr
|
||||
.disposeOnDestroy()
|
||||
}
|
||||
|
||||
|
||||
/* ==========================================================================================
|
||||
* DATA
|
||||
* ========================================================================================== */
|
||||
|
@ -82,6 +82,7 @@ class CallTransferActivity : VectorBaseActivity<ActivityCallTransferBinding>(),
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
waitingView = views.waitingView.waitingView
|
||||
sharedActionViewModel = viewModelProvider.get(UserListSharedActionViewModel::class.java)
|
||||
sharedActionViewModel
|
||||
.observe()
|
||||
@ -111,9 +112,12 @@ class CallTransferActivity : VectorBaseActivity<ActivityCallTransferBinding>(),
|
||||
callTransferViewModel.observeViewEvents {
|
||||
when (it) {
|
||||
is CallTransferViewEvents.Dismiss -> finish()
|
||||
CallTransferViewEvents.Loading -> showWaitingView()
|
||||
is CallTransferViewEvents.FailToTransfer -> showSnackbar(getString(R.string.call_transfer_failure))
|
||||
}
|
||||
}
|
||||
configureToolbar(views.callTransferToolbar)
|
||||
views.callTransferToolbar.title = getString(R.string.call_transfer_title)
|
||||
setupConnectAction()
|
||||
}
|
||||
|
||||
@ -150,7 +154,7 @@ class CallTransferActivity : VectorBaseActivity<ActivityCallTransferBinding>(),
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
|
||||
fun newIntent(context: Context, callId: String): Intent {
|
||||
return Intent(context, CallTransferActivity::class.java).also {
|
||||
it.putExtra(MvRx.KEY_ARG, CallTransferArgs(callId))
|
||||
|
@ -17,7 +17,10 @@
|
||||
package im.vector.app.features.call.transfer
|
||||
|
||||
import im.vector.app.core.platform.VectorViewEvents
|
||||
import im.vector.app.features.roommemberprofile.RoomMemberProfileViewEvents
|
||||
|
||||
sealed class CallTransferViewEvents : VectorViewEvents {
|
||||
object Dismiss : CallTransferViewEvents()
|
||||
object Loading: CallTransferViewEvents()
|
||||
object FailToTransfer : CallTransferViewEvents()
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package im.vector.app.features.call.transfer
|
||||
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.airbnb.mvrx.ActivityViewModelContext
|
||||
import com.airbnb.mvrx.Fail
|
||||
import com.airbnb.mvrx.MvRxViewModelFactory
|
||||
import com.airbnb.mvrx.ViewModelContext
|
||||
import com.squareup.inject.assisted.Assisted
|
||||
@ -81,9 +82,11 @@ class CallTransferViewModel @AssistedInject constructor(@Assisted initialState:
|
||||
private fun transferCall(action: CallTransferAction.Connect) {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
_viewEvents.post(CallTransferViewEvents.Loading)
|
||||
call?.mxCall?.transfer(action.selectedUserId, null)
|
||||
_viewEvents.post(CallTransferViewEvents.Dismiss)
|
||||
} catch (failure: Throwable) {
|
||||
Timber.v("Fail to transfer call: $failure")
|
||||
_viewEvents.post(CallTransferViewEvents.FailToTransfer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
package im.vector.app.features.contactsbook
|
||||
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.airbnb.mvrx.ActivityViewModelContext
|
||||
import com.airbnb.mvrx.FragmentViewModelContext
|
||||
@ -31,9 +30,6 @@ import im.vector.app.core.contacts.MappedContact
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.platform.EmptyViewEvents
|
||||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.features.createdirect.CreateDirectRoomActivity
|
||||
import im.vector.app.features.invite.InviteUsersToRoomActivity
|
||||
import im.vector.app.features.userdirectory.UserListViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.MatrixCallback
|
||||
|
@ -35,7 +35,6 @@ import im.vector.app.core.utils.toast
|
||||
import im.vector.app.features.call.conference.JitsiCallViewModel
|
||||
import im.vector.app.features.call.conference.VectorJitsiActivity
|
||||
import im.vector.app.features.call.transfer.CallTransferActivity
|
||||
import im.vector.app.features.call.transfer.CallTransferArgs
|
||||
import im.vector.app.features.createdirect.CreateDirectRoomActivity
|
||||
import im.vector.app.features.crypto.keysbackup.settings.KeysBackupManageActivity
|
||||
import im.vector.app.features.crypto.keysbackup.setup.KeysBackupSetupActivity
|
||||
|
@ -191,7 +191,7 @@ class UserListFragment @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun getCurrentState() = withState(viewModel){ it }
|
||||
fun getCurrentState() = withState(viewModel) { it }
|
||||
|
||||
override fun onInviteFriendClick() {
|
||||
viewModel.handle(UserListAction.ComputeMatrixToLinkForSharing)
|
||||
|
@ -49,7 +49,6 @@ data class UserListViewState(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun showInviteActions() = showInviteActions && pendingSelections.isEmpty()
|
||||
|
||||
fun showInviteActions() = showInviteActions && pendingSelections.isEmpty()
|
||||
}
|
||||
|
@ -42,6 +42,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:enabled="false"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
@ -67,7 +68,9 @@
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<include layout="@layout/merge_overlay_waiting_view" />
|
||||
<include
|
||||
android:id="@+id/waiting_view"
|
||||
layout="@layout/merge_overlay_waiting_view" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
@ -2785,6 +2785,7 @@
|
||||
<string name="call_transfer_consult_first">Consult first</string>
|
||||
<string name="call_transfer_connect_action">Connect</string>
|
||||
<string name="call_transfer_title">Transfer</string>
|
||||
<string name="call_transfer_failure">An error occured while transfering call</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user