Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into hs/mention-spam-prote…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
Half-Shot committed Sep 20, 2024
2 parents 0c75c17 + f66ac77 commit 7689475
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 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
2 changes: 1 addition & 1 deletion src/protections/ProtectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export class ProtectionManager {
LogService.error("ProtectionManager", "Error handling protection: " + protection.name);
LogService.error("ProtectionManager", "Failed event: " + eventPermalink);
LogService.error("ProtectionManager", extractRequestError(e));
await this.mjolnir.client.sendNotice(this.mjolnir.managementRoomId, "There was an error processing an event through a protection - see log for details. Event: " + eventPermalink);
await this.mjolnir.client.sendNotice(this.mjolnir.managementRoomId, `There was an error processing an event through a protection (${protection.name}) - see log for details. Event: ${eventPermalink}`);
continue;
}

Expand Down

0 comments on commit 7689475

Please sign in to comment.