mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/telegramdesktop/tdesktop
synced 2026-09-20 16:13:46 +08:00
Scope the rich message button guard to the message
Task: 2026/07/30/scope-rich-button-guard-to-message
This commit is contained in:
@@ -638,4 +638,28 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
|
||||
});
|
||||
}
|
||||
|
||||
void ActivateRichPageBotButton(
|
||||
ClickHandlerContext context,
|
||||
const HistoryMessageMarkupButton &button) {
|
||||
const auto strong = context.sessionWindow.get();
|
||||
if (!strong) {
|
||||
return;
|
||||
}
|
||||
const auto owner = &strong->session().data();
|
||||
const auto itemId = context.itemId;
|
||||
const auto key = HistoryMessageMarkupButton::RegisterRichPageButton(
|
||||
owner,
|
||||
itemId,
|
||||
button);
|
||||
if (key.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
ActivateBotButton(context, [=] {
|
||||
return HistoryMessageMarkupButton::GetRichPageButton(
|
||||
owner,
|
||||
itemId,
|
||||
key);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace Api
|
||||
|
||||
Reference in New Issue
Block a user