From faf3d3d9ebe767a09c48d3eda67cab3efa3683d0 Mon Sep 17 00:00:00 2001 From: MarkusRost <2701034-MarkusRost@users.noreply.gitlab.com> Date: Thu, 11 Jul 2024 18:57:52 +0000 Subject: [PATCH] fix thank button for logs --- extensions/hooks/buttons.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/hooks/buttons.py b/extensions/hooks/buttons.py index 523f841..9aacce2 100644 --- a/extensions/hooks/buttons.py +++ b/extensions/hooks/buttons.py @@ -66,13 +66,11 @@ def buttons_hook(message: DiscordMessage, metadata: DiscordMessageMetadata, cont if "move" in action_buttons and context.event in ("move/move", "move/move_redir"): add_button(message, BUTTON_PREFIX + " move " + str(change["pageid"]) + " " + change["title"], context.gettext("Move back"), 2, {"id": None, "name": "🔂"}) - if context.event != "edit": - return - if "rollback" in action_buttons: + if "rollback" in action_buttons and context.event == "edit": add_button(message, BUTTON_PREFIX + " rollback " + str(change["pageid"]) + " " + ( "#" + str(change["userid"]) if change["userid"] else change["user"]), context.gettext("Rollback"), 1, {"id": None, "name": "🔁"}) - if "undo" in action_buttons: + if "undo" in action_buttons and context.event == "edit": add_button(message, BUTTON_PREFIX + " undo " + str(change["pageid"]) + " " + str(change["revid"]), context.gettext("Undo"), 2, {"id": None, "name": "🔂"}) if "thank" in action_buttons and context.event != "suppressed":