From 2a9be9896fbae06837b9d837cb673f927bded15c Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Fri, 17 Jul 2026 20:10:18 +0800 Subject: [PATCH] fix: restore links when returning to summary view _summary_keyboard was called without links param in VIEW_SUMM handler, causing extracted links to disappear after viewing original text. --- src/tg_bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tg_bot.py b/src/tg_bot.py index fcd9eaf..ddd0bc3 100644 --- a/src/tg_bot.py +++ b/src/tg_bot.py @@ -326,10 +326,12 @@ def _handle_callback(tg_cfg: TelegramConfig, cfg: Config, cb: dict): elif action == CALLBACK_VIEW_SUMM and ctx: can_reply = ctx.get("can_reply", True) + is_promotion = ctx.get("summary_data", {}).get("category") == "promotion" + links = ctx.get("summary_data", {}).get("links", []) _tg_req(tg_cfg, "editMessageText", { "chat_id": chat_id, "message_id": msg_id, "text": ctx["summary_text"], "parse_mode": "MarkdownV2", - "reply_markup": _summary_keyboard(can_reply), + "reply_markup": _summary_keyboard(can_reply, is_promotion, links), }) logger.info(" 切换回摘要视图")