diff --git a/src/protections/IProtection.ts b/src/protections/IProtection.ts index 31293bb..129098f 100644 --- a/src/protections/IProtection.ts +++ b/src/protections/IProtection.ts @@ -28,7 +28,15 @@ export interface IProtection { readonly description: string; enabled: boolean; settings: { [setting: string]: AbstractProtectionSetting }; + /* + * Handle a single event from a protected room, to decide if we need to + * respond to it + */ handleEvent(mjolnir: Mjolnir, roomId: string, event: any): Promise; + /* + * Handle a single reported event from a protecte room, to decide if we + * need to respond to it + */ handleReport(mjolnir: Mjolnir, roomId: string, reporterId: string, reason: string, event: any): Promise; } export abstract class Protection implements IProtection { diff --git a/src/protections/TrustedReporters.ts b/src/protections/TrustedReporters.ts index 97949b3..7f831f7 100644 --- a/src/protections/TrustedReporters.ts +++ b/src/protections/TrustedReporters.ts @@ -21,6 +21,10 @@ import { Mjolnir } from "../Mjolnir"; const MAX_REPORTED_EVENT_BACKLOG = 20; +/* + * Hold a list of users trusted to make reports, and enact consequences on + * events that surpass configured report count thresholds + */ export class TrustedReporters extends Protection { private recentReported = new Map>();