mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 15:45:11 +00:00
better check if an user can edit addresses
This commit is contained in:
+1
-1
@@ -145,7 +145,7 @@ class SecurityAndPrivacyScreenViewModel: SecurityAndPrivacyScreenViewModelType,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func setupPermissions(powerLevels: RoomPowerLevelsProxyProtocol) {
|
private func setupPermissions(powerLevels: RoomPowerLevelsProxyProtocol) {
|
||||||
state.canEditAddress = powerLevels.canOwnUser(sendStateEvent: .roomAliases)
|
state.canEditAddress = powerLevels.canOwnUser(sendStateEvent: .roomCanonicalAlias)
|
||||||
state.canEditJoinRule = powerLevels.canOwnUser(sendStateEvent: .roomJoinRules)
|
state.canEditJoinRule = powerLevels.canOwnUser(sendStateEvent: .roomJoinRules)
|
||||||
state.canEditHistoryVisibility = powerLevels.canOwnUser(sendStateEvent: .roomHistoryVisibility)
|
state.canEditHistoryVisibility = powerLevels.canOwnUser(sendStateEvent: .roomHistoryVisibility)
|
||||||
state.canEnableEncryption = powerLevels.canOwnUser(sendStateEvent: .roomEncryption)
|
state.canEnableEncryption = powerLevels.canOwnUser(sendStateEvent: .roomEncryption)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ extension RoomPowerLevelsProxyProtocol {
|
|||||||
func canOwnUserEditSecurityAndPrivacy(isSpace: Bool, joinRule: JoinRule?) -> Bool {
|
func canOwnUserEditSecurityAndPrivacy(isSpace: Bool, joinRule: JoinRule?) -> Bool {
|
||||||
let canOwnUserChangeAddress = switch joinRule {
|
let canOwnUserChangeAddress = switch joinRule {
|
||||||
case .knockRestricted, .knock, .public:
|
case .knockRestricted, .knock, .public:
|
||||||
canOwnUser(sendStateEvent: .roomAliases)
|
canOwnUser(sendStateEvent: .roomCanonicalAlias)
|
||||||
default:
|
default:
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user