2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use Main::Session in download/upload.

This commit is contained in:
John Preston
2020-06-08 19:17:33 +04:00
parent 3878a1b212
commit 4b354b0928
47 changed files with 572 additions and 220 deletions

View File

@@ -58,8 +58,14 @@ void activateBotCommand(
not_null<const HistoryItem*> msg,
int row,
int column) {
const auto button = HistoryMessageMarkupButton::Get(msg->fullId(), row, column);
if (!button) return;
const auto button = HistoryMessageMarkupButton::Get(
&msg->history()->owner(),
msg->fullId(),
row,
column);
if (!button) {
return;
}
using ButtonType = HistoryMessageMarkupButton::Type;
switch (button->type) {
@@ -67,7 +73,11 @@ void activateBotCommand(
// Copy string before passing it to the sending method
// because the original button can be destroyed inside.
MsgId replyTo = (msg->id > 0) ? msg->id : 0;
sendBotCommand(msg->history()->peer, msg->fromOriginal()->asUser(), QString(button->text), replyTo);
sendBotCommand(
msg->history()->peer,
msg->fromOriginal()->asUser(),
QString(button->text),
replyTo);
} break;
case ButtonType::Callback:
@@ -98,7 +108,8 @@ void activateBotCommand(
case ButtonType::RequestLocation: {
hideSingleUseKeyboard(msg);
Ui::show(Box<InformBox>(tr::lng_bot_share_location_unavailable(tr::now)));
Ui::show(Box<InformBox>(
tr::lng_bot_share_location_unavailable(tr::now)));
} break;
case ButtonType::RequestPhone: {