2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

MTP_bytes() replaces MTP_string() for QByteArray payload.

Scheme updated for bot callbacks sending data bytearrays.
ReplyKeyboard edition is supported when editing the messages.
This commit is contained in:
John Preston
2016-04-01 14:23:40 +04:00
parent fa4137418a
commit 0e0956451a
18 changed files with 202 additions and 105 deletions

View File

@@ -38,8 +38,8 @@ namespace App {
if (MainWidget *m = main()) m->sendBotCommand(peer, cmd, replyTo);
}
void sendBotCallback(PeerData *peer, const QString &cmd, MsgId replyTo) {
if (MainWidget *m = main()) m->sendBotCallback(peer, cmd, replyTo);
void sendBotCallback(PeerData *peer, const QByteArray &data, MsgId replyTo) {
if (MainWidget *m = main()) m->sendBotCallback(peer, data, replyTo);
}
bool insertBotCommand(const QString &cmd, bool specialGif) {
@@ -56,11 +56,12 @@ namespace App {
} break;
case HistoryMessageReplyMarkup::Button::Callback: {
sendBotCallback(peer, QString(button.text), replyTo);
sendBotCallback(peer, button.data, replyTo);
} break;
case HistoryMessageReplyMarkup::Button::Url: {
HiddenUrlClickHandler(button.url).onClick(Qt::LeftButton);
auto url = QString::fromUtf8(button.data);
HiddenUrlClickHandler(url).onClick(Qt::LeftButton);
} break;
case HistoryMessageReplyMarkup::Button::RequestLocation: {