From 201b914304609c1dba52219474359c9d0e9e7cd0 Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 25 Mar 2021 16:35:05 +0100 Subject: [PATCH] Fix invite power level for public space --- .../sdk/internal/session/space/DefaultSpaceService.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/DefaultSpaceService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/DefaultSpaceService.kt index e6d30e2712..be801cd634 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/DefaultSpaceService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/DefaultSpaceService.kt @@ -25,6 +25,7 @@ import org.matrix.android.sdk.api.session.events.model.toContent import org.matrix.android.sdk.api.session.events.model.toModel import org.matrix.android.sdk.api.session.room.model.Membership import org.matrix.android.sdk.api.session.room.model.PowerLevelsContent +import org.matrix.android.sdk.api.session.room.model.PowerLevelsContentOverride import org.matrix.android.sdk.api.session.room.model.RoomSummary import org.matrix.android.sdk.api.session.room.model.SpaceChildInfo import org.matrix.android.sdk.api.session.room.model.create.CreateRoomPreset @@ -70,6 +71,11 @@ internal class DefaultSpaceService @Inject constructor( this.topic = topic this.preset = if (isPublic) CreateRoomPreset.PRESET_PUBLIC_CHAT else CreateRoomPreset.PRESET_PRIVATE_CHAT this.avatarUri = avatarUri + if (isPublic) { + this.powerLevelContentOverride = (powerLevelContentOverride ?: PowerLevelsContentOverride()).copy( + invite = 0 + ) + } }) }