mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Applied fixes to previous commit (thanks Markus!)
This commit is contained in:
parent
adb3b42074
commit
d9ae3306cf
|
@ -96,7 +96,6 @@ def redact_messages(ids: Union[List[Union[str, int]], set[Union[int, str]]], ent
|
|||
|
||||
def find_middle_next(ids: List[str], pageid: int) -> set:
|
||||
"""To address #235 RcGcDw should now remove diffs in next revs relative to redacted revs to protect information in revs that revert revdeleted information.
|
||||
This does not fix the problem of leaky diffs in entirety (because we are not doing diff comparisons), however the chances of fixing in most cases is pretty high
|
||||
|
||||
:arg ids - list
|
||||
:arg pageid - int
|
||||
|
@ -112,4 +111,4 @@ def find_middle_next(ids: List[str], pageid: int) -> set:
|
|||
result.add(all_in_page[all_in_page.index(id)+1])
|
||||
except (KeyError, ValueError):
|
||||
logger.debug(f"Value {id} not in {all_in_page} or no value after that.")
|
||||
return result
|
||||
return result - set(ids)
|
||||
|
|
|
@ -262,7 +262,7 @@ def rc_processor(change, changed_categories):
|
|||
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", {}): # Also redact revisions in the middle and next ones in case of content (diffs leak)
|
||||
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", []):
|
||||
|
|
Loading…
Reference in a new issue