diff --git a/src/DraupnirBotMode.ts b/src/DraupnirBotMode.ts index eeb849ff..11014981 100644 --- a/src/DraupnirBotMode.ts +++ b/src/DraupnirBotMode.ts @@ -163,7 +163,8 @@ export class DraupnirBotModeToggle implements BotModeTogle { clientsInRoomMap, clientProvider, DefaultEventDecoder, - stores.roomStateBackingStore + stores.roomStateBackingStore, + stores.hashStore ); const draupnirFactory = new DraupnirFactory( clientsInRoomMap, diff --git a/src/appservice/AppService.ts b/src/appservice/AppService.ts index 402e6b02..daeaa48d 100644 --- a/src/appservice/AppService.ts +++ b/src/appservice/AppService.ts @@ -128,7 +128,8 @@ export class MjolnirAppService { clientsInRoomMap, clientProvider, eventDecoder, - stores.roomStateBackingStore + stores.roomStateBackingStore, + stores.hashStore ); const clientCapabilityFactory = new ClientCapabilityFactory( clientsInRoomMap, diff --git a/src/protections/RedactionSynchronisation.ts b/src/protections/RedactionSynchronisation.ts index d8fb4580..b85e1401 100644 --- a/src/protections/RedactionSynchronisation.ts +++ b/src/protections/RedactionSynchronisation.ts @@ -17,6 +17,7 @@ import { PolicyListRevision, PolicyRule, PolicyRuleChange, + PolicyRuleChangeType, PolicyRuleMatchType, PolicyRuleType, PowerLevelPermission, @@ -25,7 +26,6 @@ import { ProtectionDescription, Recommendation, RoomMembershipRevision, - SimpleChangeType, Task, describeProtection, } from "matrix-protection-suite"; @@ -93,7 +93,7 @@ export class RedactionSynchronisationProtection ): Promise> { const relevantChanges = changes.filter( (change) => - change.changeType === SimpleChangeType.Added && + change.changeType !== PolicyRuleChangeType.Removed && change.rule.kind === PolicyRuleType.User && this.automaticRedactionReasons.some((reason) => reason.test(change.rule.reason ?? "") diff --git a/src/protections/RoomTakedown/RoomDiscovery.ts b/src/protections/RoomTakedown/RoomDiscovery.ts index 7dbc1076..173f307c 100644 --- a/src/protections/RoomTakedown/RoomDiscovery.ts +++ b/src/protections/RoomTakedown/RoomDiscovery.ts @@ -8,7 +8,7 @@ import { Logger, RoomBasicDetails, RoomHashRecord, - SHA256RoomHashStore, + SHA256HashStore, StandardBatcher, Task, } from "matrix-protection-suite"; @@ -47,7 +47,7 @@ export class SynapseHTTPAntispamRoomDiscovery ); constructor( private readonly synapseHTTPAntispam: SynapseHttpAntispam, - private readonly hashStore: SHA256RoomHashStore, + private readonly hashStore: SHA256HashStore, private readonly roomDetailsProvider: RoomDetailsProvider ) { super(); diff --git a/src/protections/RoomTakedown/RoomTakedown.ts b/src/protections/RoomTakedown/RoomTakedown.ts index 4a24673c..9e12948a 100644 --- a/src/protections/RoomTakedown/RoomTakedown.ts +++ b/src/protections/RoomTakedown/RoomTakedown.ts @@ -8,10 +8,10 @@ import { Logger, PolicyListRevision, PolicyRuleChange, + PolicyRuleChangeType, PolicyRuleMatchType, PolicyRuleType, Recommendation, - SimpleChangeType, } from "matrix-protection-suite"; import { RoomAuditLog } from "./RoomAuditLog"; import { isError, Ok, Result, ResultError } from "@gnuxie/typescript-result"; @@ -93,7 +93,7 @@ export class StandardRoomTakedown implements RoomTakedownService { const roomsToTakedown: LiteralPolicyRule[] = []; for (const change of changes) { if ( - change.changeType === SimpleChangeType.Added && + change.changeType === PolicyRuleChangeType.RevealedLiteral && change.rule.kind === PolicyRuleType.Room && change.rule.matchType === PolicyRuleMatchType.Literal && change.rule.recommendation === Recommendation.Takedown diff --git a/test/unit/protections/RoomTakedownServiceTest.ts b/test/unit/protections/RoomTakedownServiceTest.ts index 5bb9785d..97018ef0 100644 --- a/test/unit/protections/RoomTakedownServiceTest.ts +++ b/test/unit/protections/RoomTakedownServiceTest.ts @@ -9,10 +9,10 @@ import { describeProtectedRoomsSet, Ok, parsePolicyRule, + PolicyRuleChangeType, PolicyRuleType, randomRoomID, Recommendation, - SimpleChangeType, StandardPolicyListRevision, } from "matrix-protection-suite"; import { RoomAuditLog } from "../../../src/protections/RoomTakedown/RoomAuditLog"; @@ -81,7 +81,7 @@ describe("", function () { StandardPolicyListRevision.blankRevision(), [ { - changeType: SimpleChangeType.Added, + changeType: PolicyRuleChangeType.Added, rule: policy, event: policy.sourceEvent, sender: policy.sourceEvent.sender,