2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Support url authorizations.

This commit is contained in:
John Preston
2019-05-22 16:29:02 +02:00
parent 8660f976a9
commit c92a798e1b
12 changed files with 473 additions and 144 deletions

View File

@@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "apiwrap.h"
#include "auth_session.h"
#include "boxes/confirm_box.h"
#include "boxes/url_auth_box.h"
#include "window/layer_widget.h"
#include "lang/lang_keys.h"
#include "base/observer.h"
@@ -62,15 +63,7 @@ void activateBotCommand(
not_null<const HistoryItem*> msg,
int row,
int column) {
const HistoryMessageMarkupButton *button = nullptr;
if (auto markup = msg->Get<HistoryMessageReplyMarkup>()) {
if (row < markup->rows.size()) {
auto &buttonRow = markup->rows[row];
if (column < buttonRow.size()) {
button = &buttonRow[column];
}
}
}
const auto button = HistoryMessageMarkupButton::Get(msg->fullId(), row, column);
if (!button) return;
using ButtonType = HistoryMessageMarkupButton::Type;
@@ -147,6 +140,10 @@ void activateBotCommand(
}
}
} break;
case ButtonType::Auth:
UrlAuthBox::Activate(msg, row, column);
break;
}
}