mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-21 17:05:39 +03:00
lifting voip setting to a voip config
This commit is contained in:
parent
56afac26ad
commit
b6d052e58d
5 changed files with 35 additions and 6 deletions
|
@ -55,6 +55,12 @@ object Config {
|
|||
*/
|
||||
val ONBOARDING_VARIANT = OnboardingVariant.FTUE_AUTH
|
||||
|
||||
/**
|
||||
* If set, MSC3086 asserted identity messages sent on VoIP calls will cause the call to appear in the room corresponding to the asserted identity.
|
||||
* This *must* only be set in trusted environments.
|
||||
*/
|
||||
const val HANDLE_CALL_ASSERTED_IDENTITY_EVENTS = false
|
||||
|
||||
/**
|
||||
* The analytics configuration to use for the Debug build type.
|
||||
* Can be disabled by providing Analytics.Disabled
|
||||
|
@ -113,7 +119,6 @@ sealed interface Analytics {
|
|||
) : Analytics
|
||||
}
|
||||
|
||||
|
||||
enum class OnboardingVariant {
|
||||
LEGACY,
|
||||
LOGIN_2,
|
||||
|
|
|
@ -156,10 +156,6 @@ android {
|
|||
buildConfigField "String", "GIT_BRANCH_NAME", "\"${gitBranchName()}\""
|
||||
buildConfigField "String", "BUILD_NUMBER", "\"${buildNumber}\""
|
||||
|
||||
// If set, MSC3086 asserted identity messages sent on VoIP calls will cause the call to appear in the room corresponding to the asserted identity.
|
||||
// This *must* only be set in trusted environments.
|
||||
buildConfigField "Boolean", "handleCallAssertedIdentityEvents", "false"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
// Keep abiFilter for the universalApk
|
||||
|
|
|
@ -25,6 +25,7 @@ import im.vector.app.config.Analytics
|
|||
import im.vector.app.config.Config
|
||||
import im.vector.app.config.KeySharingStrategy
|
||||
import im.vector.app.features.analytics.AnalyticsConfig
|
||||
import im.vector.app.features.call.webrtc.VoipConfig
|
||||
import im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy
|
||||
import im.vector.app.features.home.room.detail.composer.voice.VoiceMessageConfig
|
||||
import im.vector.app.features.location.LocationSharingConfig
|
||||
|
@ -69,4 +70,9 @@ object ConfigurationModule {
|
|||
fun providesLocationSharingConfig() = LocationSharingConfig(
|
||||
mapTilerKey = Config.LOCATION_MAP_TILER_KEY,
|
||||
)
|
||||
|
||||
@Provides
|
||||
fun providesVoipConfig() = VoipConfig(
|
||||
handleCallAssertedIdentityEvents = Config.HANDLE_CALL_ASSERTED_IDENTITY_EVENTS
|
||||
)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright (c) 2022 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package im.vector.app.features.call.webrtc
|
||||
|
||||
data class VoipConfig(
|
||||
val handleCallAssertedIdentityEvents: Boolean
|
||||
)
|
|
@ -74,6 +74,7 @@ class WebRtcCallManager @Inject constructor(
|
|||
private val activeSessionDataSource: ActiveSessionDataSource,
|
||||
private val analyticsTracker: AnalyticsTracker,
|
||||
private val unifiedPushHelper: UnifiedPushHelper,
|
||||
private val voipConfig: VoipConfig,
|
||||
) : CallListener,
|
||||
DefaultLifecycleObserver {
|
||||
|
||||
|
@ -444,7 +445,7 @@ class WebRtcCallManager @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onCallAssertedIdentityReceived(callAssertedIdentityContent: CallAssertedIdentityContent) {
|
||||
if (!BuildConfig.handleCallAssertedIdentityEvents) {
|
||||
if (!voipConfig.handleCallAssertedIdentityEvents) {
|
||||
return
|
||||
}
|
||||
val call = callsByCallId[callAssertedIdentityContent.callId]
|
||||
|
|
Loading…
Reference in a new issue