mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
This reverts commit 27ae3ec625
.
This commit is contained in:
parent
27ae3ec625
commit
bcc3405e51
2
.gitignore
vendored
2
.gitignore
vendored
@ -73,5 +73,5 @@ typings/
|
|||||||
# Python packing directories.
|
# Python packing directories.
|
||||||
mjolnir.egg-info/
|
mjolnir.egg-info/
|
||||||
|
|
||||||
# Visual Studio data
|
# VS
|
||||||
.vs
|
.vs
|
||||||
|
@ -253,7 +253,7 @@ export class Mjolnir {
|
|||||||
// Setup Web APIs
|
// Setup Web APIs
|
||||||
console.log("Creating Web APIs");
|
console.log("Creating Web APIs");
|
||||||
const reportManager = new ReportManager(this);
|
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);
|
this.webapis = new WebAPIs(reportManager, this.ruleServer);
|
||||||
|
|
||||||
// Setup join/leave listener
|
// Setup join/leave listener
|
||||||
@ -1158,9 +1158,9 @@ export class Mjolnir {
|
|||||||
return await this.eventRedactionQueue.process(this, roomId);
|
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) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
* need to respond to it
|
||||||
*/
|
*/
|
||||||
async handleReport(mjolnir: Mjolnir, roomId: string, reporterId: string, event: any, reason?: string): Promise<any> {
|
async handleReport(mjolnir: Mjolnir, roomId: string, reporterId: string, event: any, reason?: string): Promise<any> {
|
||||||
|
Loading…
Reference in New Issue
Block a user