Ignore the case where the rev-deleted action is an image from teh archive

This commit is contained in:
Frisk 2025-01-13 21:19:05 +01:00
parent 4c82458ca2
commit d0f209e6c6

View file

@ -695,6 +695,8 @@ async def rc_processor(wiki: Wiki, change: dict, changed_categories: dict, displ
logparams = change.get('logparams', {"ids": []})
if logparams.get("type", "") == "oldimage":
await wiki.redact_images(context, logparams.get("ids", []), logparams.get("new", {}), page_id=change.get("pageid", -1))
elif logparams.get("type", "") == "filearchive": # Ignore filearchive (past version of the file gets revdeleted)
pass
else:
await wiki.redact_messages(context, logparams.get("ids", []), "rev_id", logparams.get("new", {}), page_id=change.get("pageid", -1))
await wiki.delete_messages(dict(rev_id=[int(x) for x in logparams.get("ids", [])], message_display=0))