From 0ad2f0d3f28247a952cd8d4b55c8faa841a3a82d Mon Sep 17 00:00:00 2001 From: gnuxie Date: Thu, 14 Nov 2024 13:50:44 +0000 Subject: [PATCH] Update draupnir factory for new protection config backends. --- .../DraupnirProtectedRoomsSet.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/draupnirfactory/DraupnirProtectedRoomsSet.ts b/src/draupnirfactory/DraupnirProtectedRoomsSet.ts index e2bf4e91..93718b4a 100644 --- a/src/draupnirfactory/DraupnirProtectedRoomsSet.ts +++ b/src/draupnirfactory/DraupnirProtectedRoomsSet.ts @@ -19,6 +19,7 @@ import { MjolnirEnabledProtectionsEventType, MjolnirPolicyRoomsConfig, MjolnirProtectedRoomsConfig, + MjolnirProtectionSettingsConfig, MjolnirProtectionSettingsEventType, MjolnirProtectionsConfig, Ok, @@ -33,6 +34,7 @@ import { RoomStateManager, StandardProtectedRoomsManager, StandardProtectedRoomsSet, + StandardProtectionCapabilityProviderSetConfig, StandardProtectionsManager, StandardSetMembership, StandardSetRoomState, @@ -40,7 +42,7 @@ import { } from "matrix-protection-suite"; import { BotSDKAccountDataConfigBackend, - BotSDKMatrixStateData, + BotSDKRoomStateConfigBackend, MatrixSendClient, } from "matrix-protection-suite-for-matrix-bot-sdk"; import { DefaultEnabledProtectionsMigration } from "../protections/DefaultEnabledProtectionsMigration"; @@ -134,10 +136,16 @@ async function makeProtectionsManager( return Ok( new StandardProtectionsManager( protectionsConfigResult.ok, - new BotSDKMatrixStateData( - MjolnirProtectionSettingsEventType, - result.ok, - client + new StandardProtectionCapabilityProviderSetConfig(), + new MjolnirProtectionSettingsConfig((description) => + Ok( + new BotSDKRoomStateConfigBackend( + client, + managementRoom.toRoomIDOrAlias(), + MjolnirProtectionSettingsEventType, + description.name + ) + ) ) ) );