2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Strict alignment request for base::lambda. Various improvements.

This commit is contained in:
John Preston
2016-11-20 15:54:07 +03:00
parent 8a0c275658
commit e880c4876e
72 changed files with 278 additions and 265 deletions

View File

@@ -44,6 +44,12 @@ void sendBotCommand(PeerData *peer, UserData *bot, const QString &cmd, MsgId rep
}
}
void hideSingleUseKeyboard(const HistoryItem *msg) {
if (auto m = main()) {
m->hideSingleUseKeyboard(msg->history()->peer, msg->id);
}
}
bool insertBotCommand(const QString &cmd, bool specialGif) {
if (auto m = main()) {
return m->insertBotCommand(cmd, specialGif);
@@ -85,11 +91,13 @@ void activateBotCommand(const HistoryItem *msg, int row, int col) {
} break;
case ButtonType::RequestLocation: {
hideSingleUseKeyboard(msg);
Ui::showLayer(new InformBox(lang(lng_bot_share_location_unavailable)));
} break;
case ButtonType::RequestPhone: {
SharePhoneConfirmBox *box = new SharePhoneConfirmBox(msg->history()->peer);
hideSingleUseKeyboard(msg);
auto box = new SharePhoneConfirmBox(msg->history()->peer);
box->connect(box, SIGNAL(confirmed(PeerData*)), App::main(), SLOT(onSharePhoneWithBot(PeerData*)));
Ui::showLayer(box);
} break;