From 822c47d15f4d2b0115f7f94f5c2e31ac5d289bf0 Mon Sep 17 00:00:00 2001 From: Marinus Enzinger Date: Mon, 21 Sep 2020 17:34:55 +0200 Subject: [PATCH] Fix widget creation permission check Signed-off-by: Marinus Enzinger --- CHANGES.md | 1 + .../android/sdk/internal/session/widgets/WidgetManager.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 4058dcda6b..92c5c56647 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ Bugfix 🐛: - Long message cannot be sent/takes infinite time & blocks other messages #1397 - User Verification in DM not working - Manual import of Megolm keys does back up the imported keys + - Fix incorrect permission check when creating widgets (#2137) Translations 🗣: - diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/WidgetManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/WidgetManager.kt index cb9059b089..b167b5ca0c 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/WidgetManager.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/WidgetManager.kt @@ -202,6 +202,6 @@ internal class WidgetManager @Inject constructor(private val integrationManager: stateKey = QueryStringValue.NoCondition ) val powerLevelsContent = powerLevelsEvent?.content?.toModel() ?: return false - return PowerLevelsHelper(powerLevelsContent).isUserAllowedToSend(userId, true, null) + return PowerLevelsHelper(powerLevelsContent).isUserAllowedToSend(userId, true, EventType.STATE_ROOM_WIDGET_LEGACY) } }