From cb2f00f1f70b561aed6d83b67c0ee181efc12853 Mon Sep 17 00:00:00 2001 From: yostyle Date: Tue, 23 Jul 2024 15:54:53 +0200 Subject: [PATCH 1/4] 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" /> Date: Tue, 23 Jul 2024 16:15:17 +0200 Subject: [PATCH 2/4] Add changelog --- changelog.d/1078.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/1078.feature diff --git a/changelog.d/1078.feature b/changelog.d/1078.feature new file mode 100644 index 0000000000..cd2ba4b9fd --- /dev/null +++ b/changelog.d/1078.feature @@ -0,0 +1 @@ +Activation des appels vidéos pour DINUM. \ No newline at end of file From 1f98ff657169a79eed025434e083ed32d6d9d25e Mon Sep 17 00:00:00 2001 From: yostyle Date: Tue, 23 Jul 2024 16:21:01 +0200 Subject: [PATCH 3/4] Upgrade version --- towncrier.toml | 2 +- vector-app/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/towncrier.toml b/towncrier.toml index c7cfa32428..77802943a1 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -1,5 +1,5 @@ [tool.towncrier] - version = "2.12.0" + version = "2.13.0" directory = "changelog.d" filename = "TCHAP_CHANGES.md" name = "Changes in Tchap" diff --git a/vector-app/build.gradle b/vector-app/build.gradle index 04593929e2..62a207cdd9 100644 --- a/vector-app/build.gradle +++ b/vector-app/build.gradle @@ -33,7 +33,7 @@ knit { // Note: 2 digits max for each value ext.versionMajor = 2 -ext.versionMinor = 12 +ext.versionMinor = 13 // Note: even values are reserved for regular release, odd values for hotfix release. // When creating a hotfix, you should decrease the value, since the current value // is the value for the next regular release. From b3c3ba79a3b688330b1b97c366e5e4ac13f776e6 Mon Sep 17 00:00:00 2001 From: yostyle Date: Tue, 23 Jul 2024 16:26:07 +0200 Subject: [PATCH 4/4] Restore default voice and video settings visibility --- vector-config/src/main/res/values/config-settings.xml | 5 +---- vector/src/main/res/xml/vector_settings_root.xml | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/vector-config/src/main/res/values/config-settings.xml b/vector-config/src/main/res/values/config-settings.xml index 1589292346..4863077d51 100755 --- a/vector-config/src/main/res/values/config-settings.xml +++ b/vector-config/src/main/res/values/config-settings.xml @@ -12,10 +12,7 @@ true true true - - - - + true true false true diff --git a/vector/src/main/res/xml/vector_settings_root.xml b/vector/src/main/res/xml/vector_settings_root.xml index 9dcd920595..36bc96ee42 100644 --- a/vector/src/main/res/xml/vector_settings_root.xml +++ b/vector/src/main/res/xml/vector_settings_root.xml @@ -24,7 +24,7 @@ android:icon="@drawable/ic_settings_root_call" android:title="@string/preference_voice_and_video" app:fragment="im.vector.app.features.settings.VectorSettingsVoiceVideoFragment" - app:isPreferenceVisible="@bool/tchap_is_visio_supported" /> + app:isPreferenceVisible="@bool/settings_root_voice_video_visible" />