From cb2f00f1f70b561aed6d83b67c0ee181efc12853 Mon Sep 17 00:00:00 2001 From: yostyle Date: Tue, 23 Jul 2024 15:54:53 +0200 Subject: [PATCH] Enable visio for DINUM instance --- .../app/features/debug/features/DebugVectorFeatures.kt | 2 +- .../src/btchap/res/values/config-features.xml | 2 +- .../src/devTchap/res/values/config-features.xml | 2 +- vector-config/src/tchap/res/values/config-features.xml | 4 +++- .../src/withdmvoip/res/values/config-features.xml | 2 +- .../src/withvoip/res/values/config-features.xml | 2 +- .../main/java/im/vector/app/features/VectorFeatures.kt | 6 +++--- .../app/features/home/room/detail/TimelineViewModel.kt | 10 +++++----- .../room/detail/timeline/factory/CallItemFactory.kt | 2 +- .../room/detail/timeline/factory/WidgetItemFactory.kt | 2 +- .../room/detail/timeline/item/CallTileTimelineItem.kt | 8 ++++---- vector/src/main/res/xml/vector_settings_root.xml | 2 +- 12 files changed, 23 insertions(+), 21 deletions(-) diff --git a/vector-app/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt b/vector-app/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt index f982223665..6a3b20899a 100644 --- a/vector-app/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt +++ b/vector-app/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt @@ -40,7 +40,7 @@ class DebugVectorFeatures( private val dataStore = context.dataStore - override fun tchapIsVoipSupported(homeServerUrl: String) = vectorFeatures.tchapIsVoipSupported(homeServerUrl) + override fun tchapIsVisioSupported(homeServerUrl: String) = vectorFeatures.tchapIsVisioSupported(homeServerUrl) override fun tchapIsCrossSigningEnabled() = vectorFeatures.tchapIsCrossSigningEnabled() diff --git a/vector-config/src/btchap/res/values/config-features.xml b/vector-config/src/btchap/res/values/config-features.xml index 683c904075..60e0cb1865 100755 --- a/vector-config/src/btchap/res/values/config-features.xml +++ b/vector-config/src/btchap/res/values/config-features.xml @@ -5,5 +5,5 @@ false true - + diff --git a/vector-config/src/devTchap/res/values/config-features.xml b/vector-config/src/devTchap/res/values/config-features.xml index 683c904075..60e0cb1865 100755 --- a/vector-config/src/devTchap/res/values/config-features.xml +++ b/vector-config/src/devTchap/res/values/config-features.xml @@ -5,5 +5,5 @@ false true - + diff --git a/vector-config/src/tchap/res/values/config-features.xml b/vector-config/src/tchap/res/values/config-features.xml index 683c904075..9990fc02d7 100755 --- a/vector-config/src/tchap/res/values/config-features.xml +++ b/vector-config/src/tchap/res/values/config-features.xml @@ -5,5 +5,7 @@ false true - + + agent.dinum.tchap.gouv.fr + diff --git a/vector-config/src/withdmvoip/res/values/config-features.xml b/vector-config/src/withdmvoip/res/values/config-features.xml index 6f4b43e696..9d39f6da24 100755 --- a/vector-config/src/withdmvoip/res/values/config-features.xml +++ b/vector-config/src/withdmvoip/res/values/config-features.xml @@ -1,4 +1,4 @@ - true + true diff --git a/vector-config/src/withvoip/res/values/config-features.xml b/vector-config/src/withvoip/res/values/config-features.xml index 6f4b43e696..9d39f6da24 100755 --- a/vector-config/src/withvoip/res/values/config-features.xml +++ b/vector-config/src/withvoip/res/values/config-features.xml @@ -1,4 +1,4 @@ - true + true diff --git a/vector/src/main/java/im/vector/app/features/VectorFeatures.kt b/vector/src/main/java/im/vector/app/features/VectorFeatures.kt index 2315005aec..fdaae5f2b7 100644 --- a/vector/src/main/java/im/vector/app/features/VectorFeatures.kt +++ b/vector/src/main/java/im/vector/app/features/VectorFeatures.kt @@ -27,7 +27,7 @@ import javax.inject.Inject interface VectorFeatures { - fun tchapIsVoipSupported(homeServerUrl: String): Boolean + fun tchapIsVisioSupported(homeServerUrl: String): Boolean fun tchapIsCrossSigningEnabled(): Boolean fun tchapIsKeyBackupEnabled(): Boolean fun tchapIsThreadEnabled(): Boolean @@ -63,8 +63,8 @@ class DefaultVectorFeatures @Inject constructor( private val stringArrayProvider: StringArrayProvider, private val booleanProvider: BooleanProvider ) : VectorFeatures { - override fun tchapIsVoipSupported(homeServerUrl: String) = booleanProvider.getBoolean(R.bool.tchap_is_voip_supported) && - stringArrayProvider.getStringArray(R.array.tchap_is_voip_supported_homeservers).let { homeServerUrls -> + override fun tchapIsVisioSupported(homeServerUrl: String) = booleanProvider.getBoolean(R.bool.tchap_is_visio_supported) && + stringArrayProvider.getStringArray(R.array.tchap_is_visio_supported_homeservers).let { homeServerUrls -> homeServerUrls.isEmpty() || homeServerUrls.any { homeServerUrl.contains(it) } } override fun tchapIsCrossSigningEnabled() = booleanProvider.getBoolean(R.bool.tchap_is_cross_signing_enabled) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt index 41a71a9a62..349ddebccf 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt @@ -863,12 +863,12 @@ class TimelineViewModel @AssistedInject constructor( R.id.timeline_setting -> true R.id.invite -> state.canInvite R.id.open_matrix_apps -> false // TCHAP there are no matrix apps - // TCHAP check if voip is enabled - R.id.video_call -> vectorPreferences.developerMode() && vectorFeatures.tchapIsVoipSupported(session.sessionParams.homeServerUrl) - R.id.voice_call -> vectorFeatures.tchapIsVoipSupported(session.sessionParams.homeServerUrl) && - (state.isCallOptionAvailable() || state.hasActiveElementCallWidget()) + R.id.voice_call -> state.isCallOptionAvailable() || state.hasActiveElementCallWidget() + // TCHAP check if visio is enabled + R.id.video_call -> vectorFeatures.tchapIsVisioSupported(session.sessionParams.homeServerUrl) && + (state.isCallOptionAvailable() || state.jitsiState.confId == null || state.jitsiState.hasJoined) // Show Join conference button only if there is an active conf id not joined. Otherwise fallback to default video disabled. ^ - R.id.join_conference -> vectorFeatures.tchapIsVoipSupported(session.sessionParams.homeServerUrl) && !state.isCallOptionAvailable() && + R.id.join_conference -> vectorFeatures.tchapIsVisioSupported(session.sessionParams.homeServerUrl) && !state.isCallOptionAvailable() && state.jitsiState.confId != null && !state.jitsiState.hasJoined R.id.search -> state.isSearchAvailable() R.id.menu_timeline_thread_list -> vectorPreferences.areThreadMessagesEnabled() diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/CallItemFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/CallItemFactory.kt index 5ea450ba32..2ab5d81e9d 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/CallItemFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/CallItemFactory.kt @@ -147,7 +147,7 @@ class CallItemFactory @Inject constructor( val userOfInterest = roomSummary.toMatrixItem() val attributes = messageItemAttributesFactory.create(null, informationData, callback, reactionsSummaryEvents).let { CallTileTimelineItem.Attributes( - isVoipSupported = vectorFeatures.tchapIsVoipSupported(session.sessionParams.homeServerUrl), + isCallSupported = vectorFeatures.tchapIsVisioSupported(session.sessionParams.homeServerUrl) || callKind.isVoiceCall, callId = callId, callKind = callKind, callStatus = callStatus, diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/WidgetItemFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/WidgetItemFactory.kt index b8dc6be9fc..2e674384cd 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/WidgetItemFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/WidgetItemFactory.kt @@ -80,7 +80,7 @@ class WidgetItemFactory @Inject constructor( CallTileTimelineItem.CallStatus.ENDED } val attributes = CallTileTimelineItem.Attributes( - isVoipSupported = vectorFeatures.tchapIsVoipSupported(session.sessionParams.homeServerUrl), + isCallSupported = vectorFeatures.tchapIsVisioSupported(session.sessionParams.homeServerUrl), callId = jitsiWidgetEventsGroup.callId, callKind = CallTileTimelineItem.CallKind.CONFERENCE, callStatus = callStatus, diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/CallTileTimelineItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/CallTileTimelineItem.kt index af9a82c7af..5880ae6fda 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/CallTileTimelineItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/CallTileTimelineItem.kt @@ -233,9 +233,9 @@ abstract class CallTileTimelineItem : AbsBaseMessageItem + app:isPreferenceVisible="@bool/tchap_is_visio_supported" />