mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Show error on webapp share-to-story.
This commit is contained in:
parent
eec9c8a46b
commit
3001464f6b
3 changed files with 17 additions and 0 deletions
|
@ -3249,6 +3249,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_bot_add_to_side_menu" = "{bot} asks your permission to be added as an option to your main menu so you can access it any time.";
|
"lng_bot_add_to_side_menu" = "{bot} asks your permission to be added as an option to your main menu so you can access it any time.";
|
||||||
"lng_bot_add_to_side_menu_done" = "Bot added to the main menu.";
|
"lng_bot_add_to_side_menu_done" = "Bot added to the main menu.";
|
||||||
"lng_bot_no_scan_qr" = "QR Codes for bots are not supported on Desktop. Please use one of Telegram's mobile apps.";
|
"lng_bot_no_scan_qr" = "QR Codes for bots are not supported on Desktop. Please use one of Telegram's mobile apps.";
|
||||||
|
"lng_bot_no_share_story" = "Sharing to Stories is not supported on Desktop. Please use one of Telegram's mobile apps.";
|
||||||
"lng_bot_click_to_start" = "Click here to use this bot.";
|
"lng_bot_click_to_start" = "Click here to use this bot.";
|
||||||
"lng_bot_status_users#one" = "{count} user";
|
"lng_bot_status_users#one" = "{count} user";
|
||||||
"lng_bot_status_users#other" = "{count} users";
|
"lng_bot_status_users#other" = "{count} users";
|
||||||
|
|
|
@ -699,6 +699,8 @@ bool Panel::createWebview(const Webview::ThemeParams ¶ms) {
|
||||||
openPopup(arguments);
|
openPopup(arguments);
|
||||||
} else if (command == "web_app_open_scan_qr_popup") {
|
} else if (command == "web_app_open_scan_qr_popup") {
|
||||||
openScanQrPopup(arguments);
|
openScanQrPopup(arguments);
|
||||||
|
} else if (command == "web_app_share_to_story") {
|
||||||
|
openShareStory(arguments);
|
||||||
} else if (command == "web_app_request_write_access") {
|
} else if (command == "web_app_request_write_access") {
|
||||||
requestWriteAccess();
|
requestWriteAccess();
|
||||||
} else if (command == "web_app_request_phone") {
|
} else if (command == "web_app_request_phone") {
|
||||||
|
@ -936,6 +938,19 @@ void Panel::openScanQrPopup(const QJsonObject &args) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Panel::openShareStory(const QJsonObject &args) {
|
||||||
|
const auto widget = _webview->window.widget();
|
||||||
|
[[maybe_unused]] const auto ok = Webview::ShowBlockingPopup({
|
||||||
|
.parent = widget ? widget->window() : nullptr,
|
||||||
|
.text = tr::lng_bot_no_share_story(tr::now),
|
||||||
|
.buttons = { {
|
||||||
|
.id = "ok",
|
||||||
|
.text = tr::lng_box_ok(tr::now),
|
||||||
|
.type = Webview::PopupArgs::Button::Type::Ok,
|
||||||
|
}},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void Panel::requestWriteAccess() {
|
void Panel::requestWriteAccess() {
|
||||||
if (_inBlockingRequest) {
|
if (_inBlockingRequest) {
|
||||||
replyRequestWriteAccess(false);
|
replyRequestWriteAccess(false);
|
||||||
|
|
|
@ -135,6 +135,7 @@ private:
|
||||||
void openInvoice(const QJsonObject &args);
|
void openInvoice(const QJsonObject &args);
|
||||||
void openPopup(const QJsonObject &args);
|
void openPopup(const QJsonObject &args);
|
||||||
void openScanQrPopup(const QJsonObject &args);
|
void openScanQrPopup(const QJsonObject &args);
|
||||||
|
void openShareStory(const QJsonObject &args);
|
||||||
void requestWriteAccess();
|
void requestWriteAccess();
|
||||||
void replyRequestWriteAccess(bool allowed);
|
void replyRequestWriteAccess(bool allowed);
|
||||||
void requestPhone();
|
void requestPhone();
|
||||||
|
|
Loading…
Add table
Reference in a new issue