Skip to content

Commit

Permalink
Disable domain limit (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle authored Dec 22, 2023
1 parent 8f991ba commit 3038619
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
1 change: 1 addition & 0 deletions changelog.d/999.improvements
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Les forums sont fédérés par défaut à la création.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data class CreateRoomViewState(
val defaultEncrypted: Map<RoomJoinRules, Boolean> = 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,
Expand Down

0 comments on commit 3038619

Please sign in to comment.