mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Changed the way to recognize IP edits from regex to MediaWiki propriety
This commit is contained in:
parent
65db91fd13
commit
34a19f4311
|
@ -135,7 +135,7 @@ def webhook_formatter(action, STATIC, **params):
|
||||||
article_encoded = params["title"].replace(" ", "_").replace(')', '\)')
|
article_encoded = params["title"].replace(" ", "_").replace(')', '\)')
|
||||||
if STATIC["redirect"]:
|
if STATIC["redirect"]:
|
||||||
params["title"] = "⤷ " + params["title"]
|
params["title"] = "⤷ " + params["title"]
|
||||||
if re.match(r"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b", params["user"]) is not None:
|
if STATIC["ipaction"]:
|
||||||
author_url = "https://{wiki}.gamepedia.com/Special:Contributions/{user}".format(wiki=settings["wiki"],
|
author_url = "https://{wiki}.gamepedia.com/Special:Contributions/{user}".format(wiki=settings["wiki"],
|
||||||
user=params["user"])
|
user=params["user"])
|
||||||
logging.debug("current user: {} with cache of IPs: {}".format(params["user"], recent_changes.map_ips.keys()))
|
logging.debug("current user: {} with cache of IPs: {}".format(params["user"], recent_changes.map_ips.keys()))
|
||||||
|
@ -537,7 +537,7 @@ def first_pass(
|
||||||
if change["type"] == "edit" and "edit" not in settings["ignored"]:
|
if change["type"] == "edit" and "edit" not in settings["ignored"]:
|
||||||
logging.debug("List of categories in first_pass: {}".format(added_categories))
|
logging.debug("List of categories in first_pass: {}".format(added_categories))
|
||||||
STATIC_VARS = {**STATIC_VARS, **{"color": settings["appearance"]["edit"]["color"],
|
STATIC_VARS = {**STATIC_VARS, **{"color": settings["appearance"]["edit"]["color"],
|
||||||
"icon": settings["appearance"]["edit"]["icon"], "redirect": (True if "redirect" in change else False)}}
|
"icon": settings["appearance"]["edit"]["icon"], "redirect": (True if "redirect" in change else False), "ipaction": (True if "anon" in change else False)}}
|
||||||
webhook_formatter("edit", STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment,
|
webhook_formatter("edit", STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment,
|
||||||
oldrev=change["old_revid"], pageid=change["pageid"], diff=change["revid"],
|
oldrev=change["old_revid"], pageid=change["pageid"], diff=change["revid"],
|
||||||
size=change["newlen"] - change["oldlen"], minor=True if "minor" in change else False, new_categories=added_categories)
|
size=change["newlen"] - change["oldlen"], minor=True if "minor" in change else False, new_categories=added_categories)
|
||||||
|
|
Loading…
Reference in a new issue