mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Allow HiddenUrlClickHandler to work in a payment form.
This commit is contained in:
@@ -123,16 +123,17 @@ void HiddenUrlClickHandler::Open(QString url, QVariant context) {
|
||||
const auto use = controller
|
||||
? &controller->window()
|
||||
: Core::App().activeWindow();
|
||||
if (use) {
|
||||
use->show(
|
||||
Ui::MakeConfirmBox({
|
||||
.text = (tr::lng_open_this_link(tr::now)
|
||||
+ qsl("\n\n")
|
||||
+ displayUrl),
|
||||
.confirmed = [=](Fn<void()> hide) { hide(); open(); },
|
||||
.confirmText = tr::lng_open_link(),
|
||||
}),
|
||||
Ui::LayerOption::KeepOther);
|
||||
auto box = Ui::MakeConfirmBox({
|
||||
.text = (tr::lng_open_this_link(tr::now)
|
||||
+ qsl("\n\n")
|
||||
+ displayUrl),
|
||||
.confirmed = [=](Fn<void()> hide) { hide(); open(); },
|
||||
.confirmText = tr::lng_open_link(),
|
||||
});
|
||||
if (my.show) {
|
||||
my.show->showBox(std::move(box));
|
||||
} else if (use) {
|
||||
use->show(std::move(box), Ui::LayerOption::KeepOther);
|
||||
}
|
||||
} else {
|
||||
open();
|
||||
|
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#pragma once
|
||||
|
||||
#include "ui/basic_click_handlers.h"
|
||||
#include "data/data_msg_id.h"
|
||||
|
||||
constexpr auto kPeerLinkPeerIdProperty = 0x01;
|
||||
constexpr auto kPhotoLinkMediaProperty = 0x02;
|
||||
@@ -15,6 +16,10 @@ constexpr auto kDocumentLinkMediaProperty = 0x03;
|
||||
constexpr auto kSendReactionEmojiProperty = 0x04;
|
||||
constexpr auto kReactionsCountEmojiProperty = 0x05;
|
||||
|
||||
namespace Ui {
|
||||
class Show;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Main {
|
||||
class Session;
|
||||
} // namespace Main
|
||||
@@ -35,6 +40,7 @@ struct ClickHandlerContext {
|
||||
// Is filled from sections.
|
||||
Fn<HistoryView::ElementDelegate*()> elementDelegate;
|
||||
base::weak_ptr<Window::SessionController> sessionWindow;
|
||||
std::shared_ptr<Ui::Show> show;
|
||||
bool skipBotAutoLogin = false;
|
||||
bool botStartAutoSubmit = false;
|
||||
// Is filled from peer info.
|
||||
|
Reference in New Issue
Block a user