Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable domain limit #1001

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading