Skip to content

Commit

Permalink
Merge pull request #526 from matrix-org/hs/await-redact
Browse files Browse the repository at this point in the history
Fix NSFW protection not awaiting redaction
  • Loading branch information
turt2live authored Sep 19, 2024
2 parents 5f4178f + 4f73da3 commit d3f8c03
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/protections/NsfwProtection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ export class NsfwProtection extends Protection {
if (prediction["probability"] > mjolnir.config.nsfwSensitivity) {
await mjolnir.managementRoomOutput.logMessage(LogLevel.INFO, "NSFWProtection", `Redacting ${event["event_id"]} for inappropriate content.`);
try {
mjolnir.client.redactEvent(roomId, event["event_id"])
await mjolnir.client.redactEvent(roomId, event["event_id"]);
} catch (err) {
await mjolnir.managementRoomOutput.logMessage(LogLevel.ERROR, "NSFWProtection", `There was an error redacting ${event["event_id"]}: ${err}`);

}
}
}
Expand Down

0 comments on commit d3f8c03

Please sign in to comment.