fix namespace

This commit is contained in:
MarkusRost 2024-10-08 20:13:55 +00:00
parent a3b7d15cf0
commit 2874fdfc41

View file

@ -83,8 +83,8 @@ def talk_notify_hook(context: Context, change: dict):
author=author, author_url=author_url, article=sanitize_to_markdown(change["title"]).replace("\\:", ":"), edit_link=edit_link, comment=parsed_comment, author=author, author_url=author_url, article=sanitize_to_markdown(change["title"]).replace("\\:", ":"), edit_link=edit_link, comment=parsed_comment,
edit_size=edit_size, sign=sign, bold=bold) edit_size=edit_size, sign=sign, bold=bold)
webhook_list = talk_notify.get("default", []) webhook_list = talk_notify.get("default", [])
if change["ns"] in talk_notify.get("namespace", {}): if str(change["ns"]) in talk_notify.get("namespace", {}):
webhook_list = talk_notify.get("namespace", {}).get(change["ns"], webhook_list) webhook_list = talk_notify.get("namespace", {}).get(str(change["ns"]), webhook_list)
if change["title"] in talk_notify.get("pages", {}): if change["title"] in talk_notify.get("pages", {}):
webhook_list = talk_notify.get("pages", {}).get(change["title"], webhook_list) webhook_list = talk_notify.get("pages", {}).get(change["title"], webhook_list)
for webhook in webhook_list: for webhook in webhook_list: