From 2f8215761cf0348365866d025172d03ff2b883d7 Mon Sep 17 00:00:00 2001 From: gnuxie Date: Fri, 16 Feb 2024 17:19:20 +0000 Subject: [PATCH] Load Draupnir protections in the DraupnirProtectedRoomsSet. --- src/draupnirfactory/DraupnirProtectedRoomsSet.ts | 1 + src/protections/DraupnirProtectionsIndex.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/protections/DraupnirProtectionsIndex.ts diff --git a/src/draupnirfactory/DraupnirProtectedRoomsSet.ts b/src/draupnirfactory/DraupnirProtectedRoomsSet.ts index 60998138..d2f7c63e 100644 --- a/src/draupnirfactory/DraupnirProtectedRoomsSet.ts +++ b/src/draupnirfactory/DraupnirProtectedRoomsSet.ts @@ -28,6 +28,7 @@ limitations under the License. import { ActionResult, MJOLNIR_PROTECTED_ROOMS_EVENT_TYPE, MJOLNIR_WATCHED_POLICY_ROOMS_EVENT_TYPE, MatrixRoomID, MatrixRoomReference, MjolnirEnabledProtectionsEvent, MjolnirEnabledProtectionsEventType, MjolnirPolicyRoomsConfig, MjolnirProtectedRoomsConfig, MjolnirProtectedRoomsEvent, MjolnirProtectionSettingsEventType, MjolnirProtectionsConfig, MjolnirWatchedPolicyRoomsEvent, Ok, PolicyListConfig, PolicyRoomManager, ProtectedRoomsConfig, ProtectedRoomsSet, ProtectionsConfig, RoomMembershipManager, RoomStateManager, SetMembership, SetRoomState, StandardProtectedRoomsSet, StandardSetMembership, StandardSetRoomState, StringRoomAlias, StringRoomID, StringUserID, isError } from "matrix-protection-suite"; import { BotSDKMatrixAccountData, BotSDKMatrixStateData, MatrixSendClient, resolveRoomReferenceSafe } from "matrix-protection-suite-for-matrix-bot-sdk"; import { DefaultEnabledProtectionsMigration } from "../protections/DefaultEnabledProtectionsMigration"; +import '../protections/DraupnirProtectionsIndex'; async function makePolicyListConfig( client: MatrixSendClient, diff --git a/src/protections/DraupnirProtectionsIndex.ts b/src/protections/DraupnirProtectionsIndex.ts new file mode 100644 index 00000000..0050035f --- /dev/null +++ b/src/protections/DraupnirProtectionsIndex.ts @@ -0,0 +1,15 @@ +/** + * This file exists as a way to register all protections. + * In future, we should maybe try to dogfood the dynamic plugin load sytem + * instead. For now that system doesn't even exist. + */ + +// keep alphabetical please. +import './BanPropagation'; +import './BasicFlooding'; +import './FirstMessageIsImage'; +import './JoinWaveShortCircuit'; +import './MessageIsMedia'; +import './MessageIsVoice'; +import './TrustedReporters'; +import './WordList';