From 1247e5f40804228cf564d9d0e63423fa9c12f732 Mon Sep 17 00:00:00 2001 From: MarkusRost <2701034-MarkusRost@users.noreply.gitlab.com> Date: Wed, 2 Feb 2022 08:11:39 +0000 Subject: [PATCH] Don't run redaction on archives --- src/rcgcdw.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rcgcdw.py b/src/rcgcdw.py index 1c60c1a..6d66fc3 100644 --- a/src/rcgcdw.py +++ b/src/rcgcdw.py @@ -260,13 +260,14 @@ def rc_processor(change, changed_categories): delete_messages(dict(logid=logid)) elif identification_string == "delete/revision" and AUTO_SUPPRESSION_ENABLED: logparams = change.get('logparams', {"ids": []}) - if settings["appearance"]["mode"] == "embed": - redact_messages(logparams.get("ids", []), 0, logparams.get("new", {})) - if "content" in logparams.get("new", {}) and settings.get("appearance", {}).get("embed", {}).get("show_edit_changes", False): # Also redact revisions in the middle and next ones in case of content (diffs leak) - redact_messages(find_middle_next(logparams.get("ids", []), change.get("pageid", -1)), 0, {"content": ""}) - else: - for revid in logparams.get("ids", []): - delete_messages(dict(revid=revid)) + if logparams.get("type", "") in ("revision", "logging", "oldimage"): + if settings["appearance"]["mode"] == "embed": + redact_messages(logparams.get("ids", []), 0, logparams.get("new", {})) + if "content" in logparams.get("new", {}) and settings.get("appearance", {}).get("embed", {}).get("show_edit_changes", False): # Also redact revisions in the middle and next ones in case of content (diffs leak) + redact_messages(find_middle_next(logparams.get("ids", []), change.get("pageid", -1)), 0, {"content": ""}) + else: + for revid in logparams.get("ids", []): + delete_messages(dict(revid=revid)) run_hooks(post_hooks, discord_message, metadata, context, change) discord_message.finish_embed() send_to_discord(discord_message, metadata)