diff --git a/changelog.d/999.improvements b/changelog.d/999.improvements new file mode 100644 index 0000000000..4a1026f690 --- /dev/null +++ b/changelog.d/999.improvements @@ -0,0 +1 @@ +Les forums sont fédérés par défaut à la création. \ No newline at end of file diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt index 0d0aa4196b..2cb9151760 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewModel.kt @@ -224,20 +224,13 @@ class CreateRoomViewModel @AssistedInject constructor( } private fun setTchapRoomType(action: CreateRoomAction.SetTchapRoomType) = setState { - if (action.roomType == TchapRoomType.FORUM) { - val userHSDomain = TchapUtils.getHomeServerDisplayNameFromMXIdentifier(session.myUserId) - val isAgentServerDomain = userHSDomain.equals(AGENT_SERVER_DOMAIN, ignoreCase = true) - copy( - roomType = action.roomType, - disableFederation = !isAgentServerDomain, - isFederationSettingAvailable = !isAgentServerDomain - ) - } else { - copy( - roomType = action.roomType, - disableFederation = false - ) - } + val isFederationSettingAvailable = action.roomType == TchapRoomType.FORUM && + !TchapUtils.getHomeServerDisplayNameFromMXIdentifier(session.myUserId).equals(AGENT_SERVER_DOMAIN, ignoreCase = true) + copy( + roomType = action.roomType, + disableFederation = false, + isFederationSettingAvailable = isFederationSettingAvailable + ) } private fun setRoomAliasLocalPart(action: CreateRoomAction.SetRoomAliasLocalPart) { diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewState.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewState.kt index 23441e0c90..99f10abdf0 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewState.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/createroom/CreateRoomViewState.kt @@ -34,7 +34,7 @@ data class CreateRoomViewState( val defaultEncrypted: Map = emptyMap(), val showAdvanced: Boolean = false, val disableFederation: Boolean = false, - val isFederationSettingAvailable: Boolean = true, + val isFederationSettingAvailable: Boolean = false, val homeServerName: String = "", val userDomain: String = "", val hsAdminHasDisabledE2E: Boolean = false,