Don't run redaction on archives

This commit is contained in:
MarkusRost 2022-02-02 08:11:39 +00:00
parent 9196a9cbbe
commit 1247e5f408

View file

@ -260,13 +260,14 @@ def rc_processor(change, changed_categories):
delete_messages(dict(logid=logid)) delete_messages(dict(logid=logid))
elif identification_string == "delete/revision" and AUTO_SUPPRESSION_ENABLED: elif identification_string == "delete/revision" and AUTO_SUPPRESSION_ENABLED:
logparams = change.get('logparams', {"ids": []}) logparams = change.get('logparams', {"ids": []})
if settings["appearance"]["mode"] == "embed": if logparams.get("type", "") in ("revision", "logging", "oldimage"):
redact_messages(logparams.get("ids", []), 0, logparams.get("new", {})) if settings["appearance"]["mode"] == "embed":
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(logparams.get("ids", []), 0, logparams.get("new", {}))
redact_messages(find_middle_next(logparams.get("ids", []), change.get("pageid", -1)), 0, {"content": ""}) 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)
else: redact_messages(find_middle_next(logparams.get("ids", []), change.get("pageid", -1)), 0, {"content": ""})
for revid in logparams.get("ids", []): else:
delete_messages(dict(revid=revid)) for revid in logparams.get("ids", []):
delete_messages(dict(revid=revid))
run_hooks(post_hooks, discord_message, metadata, context, change) run_hooks(post_hooks, discord_message, metadata, context, change)
discord_message.finish_embed() discord_message.finish_embed()
send_to_discord(discord_message, metadata) send_to_discord(discord_message, metadata)