From bcc3405e519bddae03a7bed77299df5a6d76fdb9 Mon Sep 17 00:00:00 2001 From: David Teller Date: Fri, 13 May 2022 15:29:49 +0200 Subject: [PATCH] Revert "Fix traceback on Abuse Report. (#230)" (#293) This reverts commit 27ae3ec62513076aaa88a20d95df24f7be831a7e. --- .gitignore | 2 +- src/Mjolnir.ts | 6 +++--- src/protections/IProtection.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 980d78e..68e477c 100644 --- a/.gitignore +++ b/.gitignore @@ -73,5 +73,5 @@ typings/ # Python packing directories. mjolnir.egg-info/ -# Visual Studio data +# VS .vs diff --git a/src/Mjolnir.ts b/src/Mjolnir.ts index 0d4fcdd..29f0b8c 100644 --- a/src/Mjolnir.ts +++ b/src/Mjolnir.ts @@ -253,7 +253,7 @@ export class Mjolnir { // Setup Web APIs console.log("Creating Web APIs"); const reportManager = new ReportManager(this); - reportManager.on("report.new", this.handleReport.bind(this)); + reportManager.on("report.new", this.handleReport); this.webapis = new WebAPIs(reportManager, this.ruleServer); // Setup join/leave listener @@ -1158,9 +1158,9 @@ export class Mjolnir { return await this.eventRedactionQueue.process(this, roomId); } - private async handleReport(e: { roomId: string, reporterId: string, event: any, reason?: string }) { + private async handleReport(roomId: string, reporterId: string, event: any, reason?: string) { for (const protection of this.enabledProtections) { - await protection.handleReport(this, e.roomId, e.reporterId, e.event, e.reason); + await protection.handleReport(this, roomId, reporterId, event, reason); } } } diff --git a/src/protections/IProtection.ts b/src/protections/IProtection.ts index f8353bd..b8d41cd 100644 --- a/src/protections/IProtection.ts +++ b/src/protections/IProtection.ts @@ -39,7 +39,7 @@ export abstract class Protection { } /* - * Handle a single reported event from a protected room, to decide if we + * Handle a single reported event from a protecte room, to decide if we * need to respond to it */ async handleReport(mjolnir: Mjolnir, roomId: string, reporterId: string, event: any, reason?: string): Promise {