Skip to content

Commit

Permalink
Enable visio for DINUM instance (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle authored Jul 23, 2024
1 parent 217e6e2 commit 7e248e8
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 27 deletions.
1 change: 1 addition & 0 deletions changelog.d/1078.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Activation des appels vidéos pour DINUM.
2 changes: 1 addition & 1 deletion towncrier.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion vector-config/src/btchap/res/values/config-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<bool name="tchap_is_thread_enabled">false</bool>
<bool name="tchap_is_secure_backup_required">true</bool>

<string-array name="tchap_is_voip_supported_homeservers" translatable="false" />
<string-array name="tchap_is_visio_supported_homeservers" translatable="false" />
</resources>
2 changes: 1 addition & 1 deletion vector-config/src/devTchap/res/values/config-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<bool name="tchap_is_thread_enabled">false</bool>
<bool name="tchap_is_secure_backup_required">true</bool>

<string-array name="tchap_is_voip_supported_homeservers" translatable="false" />
<string-array name="tchap_is_visio_supported_homeservers" translatable="false" />
</resources>
5 changes: 1 addition & 4 deletions vector-config/src/main/res/values/config-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
<bool name="settings_root_general_visible">true</bool>
<bool name="settings_root_notification_visible">true</bool>
<bool name="settings_root_preferences_visible">true</bool>

<!-- Tchap: use gradle config -->
<!-- <bool name="settings_root_voice_video_visible">true</bool>-->

<bool name="settings_root_voice_video_visible">true</bool>
<bool name="settings_root_security_privacy_visible">true</bool>
<bool name="settings_root_labs_visible">false</bool>
<bool name="settings_root_advanced_visible">true</bool>
Expand Down
4 changes: 3 additions & 1 deletion vector-config/src/tchap/res/values/config-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<bool name="tchap_is_thread_enabled">false</bool>
<bool name="tchap_is_secure_backup_required">true</bool>

<string-array name="tchap_is_voip_supported_homeservers" translatable="false" />
<string-array name="tchap_is_visio_supported_homeservers" translatable="false">
<item>agent.dinum.tchap.gouv.fr</item>
</string-array>
</resources>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="tchap_is_voip_supported">true</bool>
<bool name="tchap_is_visio_supported">true</bool>
</resources>
2 changes: 1 addition & 1 deletion vector-config/src/withvoip/res/values/config-features.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="tchap_is_voip_supported">true</bool>
<bool name="tchap_is_visio_supported">true</bool>
</resources>
6 changes: 3 additions & 3 deletions vector/src/main/java/im/vector/app/features/VectorFeatures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ abstract class CallTileTimelineItem : AbsBaseMessageItem<CallTileTimelineItem.Ho
}

private fun renderCallSupportState(holder: Holder) {
val error = if (!attributes.isVoipSupported) holder.resources.getString(R.string.tchap_call_not_supported) else null
holder.acceptView.isEnabled = attributes.isVoipSupported
holder.rejectView.isEnabled = attributes.isVoipSupported
val error = if (!attributes.isCallSupported) holder.resources.getString(R.string.tchap_call_not_supported) else null
holder.acceptView.isEnabled = attributes.isCallSupported
holder.rejectView.isEnabled = attributes.isCallSupported
holder.errorView.setTextOrHide(error)
}

Expand Down Expand Up @@ -269,7 +269,7 @@ abstract class CallTileTimelineItem : AbsBaseMessageItem<CallTileTimelineItem.Ho
}

data class Attributes(
val isVoipSupported: Boolean,
val isCallSupported: Boolean,
val callId: String,
val callKind: CallKind,
val callStatus: CallStatus,
Expand Down
2 changes: 1 addition & 1 deletion vector/src/main/res/xml/vector_settings_root.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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_voip_supported" />
app:isPreferenceVisible="@bool/settings_root_voice_video_visible" />

<im.vector.app.core.preference.VectorPreference
android:icon="@drawable/ic_settings_root_security_privacy"
Expand Down

0 comments on commit 7e248e8

Please sign in to comment.