mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
ability to disable displaying new reports in moderation room
This commit is contained in:
parent
ed68e02c4e
commit
ca2c8e535f
@ -54,6 +54,7 @@ interface IConfig {
|
||||
*/
|
||||
backgroundDelayMS: number;
|
||||
pollReports: boolean;
|
||||
displayReports: boolean;
|
||||
admin?: {
|
||||
enableMakeRoomAdminCommand?: boolean;
|
||||
}
|
||||
@ -124,6 +125,7 @@ const defaultConfig: IConfig = {
|
||||
protectAllJoinedRooms: false,
|
||||
backgroundDelayMS: 500,
|
||||
pollReports: false,
|
||||
displayReports: false,
|
||||
commands: {
|
||||
allowNoPrefix: false,
|
||||
additionalPrefixes: [],
|
||||
|
@ -21,6 +21,7 @@ import { htmlEscape } from "../utils";
|
||||
import { JSDOM } from 'jsdom';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
import config from "../config";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
|
||||
/// Regexp, used to extract the action label from an action reaction
|
||||
@ -114,7 +115,9 @@ export class ReportManager extends EventEmitter {
|
||||
*/
|
||||
public async handleServerAbuseReport({ roomId, reporterId, event, reason }: { roomId: string, reporterId: string, event: any, reason?: string }) {
|
||||
this.emit("report.new", { roomId: roomId, reporterId: reporterId, event: event, reason: reason });
|
||||
return this.displayManager.displayReportAndUI({ kind: Kind.SERVER_ABUSE_REPORT, event, reporterId, reason, moderationRoomId: this.mjolnir.managementRoomId });
|
||||
if (config.displayReports) {
|
||||
return this.displayManager.displayReportAndUI({ kind: Kind.SERVER_ABUSE_REPORT, event, reporterId, reason, moderationRoomId: this.mjolnir.managementRoomId });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user