add hide_ip_editcount setting (#258)

This commit is contained in:
Markus-Rost 2022-10-12 12:34:13 +02:00
parent 8b724ecaa0
commit ab710f5f77

View file

@ -105,6 +105,9 @@ def embed_helper(ctx: Context, message: DiscordMessage, change: dict, set_user=T
author = None author = None
if "anon" in change if is_anon is None else is_anon: if "anon" in change if is_anon is None else is_anon:
author_url = ctx.client.create_article_path("Special:Contributions/{user}".format(user=sanitize_to_url(change["user"]))) author_url = ctx.client.create_article_path("Special:Contributions/{user}".format(user=sanitize_to_url(change["user"])))
if settings.get("hide_ip_editcount", False):
author = change["user"] if settings.get("hide_ips", False) is False else ctx._("Unregistered user")
else:
ip_mapper = ctx.client.get_ipmapper() ip_mapper = ctx.client.get_ipmapper()
logger.debug("current user: {} with cache of IPs: {}".format(change["user"], ip_mapper.keys())) logger.debug("current user: {} with cache of IPs: {}".format(change["user"], ip_mapper.keys()))
if change["user"] not in list(ip_mapper.keys()): if change["user"] not in list(ip_mapper.keys()):