mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Removed facades from url click handler types.
This commit is contained in:
parent
e25b0e791d
commit
1169c5e143
1 changed files with 28 additions and 21 deletions
|
@ -25,8 +25,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_user.h"
|
#include "data/data_user.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "boxes/abstract_box.h" // Ui::hideLayer().
|
|
||||||
#include "facades.h"
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -119,15 +117,18 @@ void HiddenUrlClickHandler::Open(QString url, QVariant context) {
|
||||||
: parsedUrl.isValid()
|
: parsedUrl.isValid()
|
||||||
? QString::fromUtf8(parsedUrl.toEncoded())
|
? QString::fromUtf8(parsedUrl.toEncoded())
|
||||||
: ShowEncoded(displayed);
|
: ShowEncoded(displayed);
|
||||||
Ui::show(
|
const auto my = context.value<ClickHandlerContext>();
|
||||||
Ui::MakeConfirmBox({
|
if (const auto controller = my.sessionWindow.get()) {
|
||||||
.text = (tr::lng_open_this_link(tr::now)
|
controller->show(
|
||||||
+ qsl("\n\n")
|
Ui::MakeConfirmBox({
|
||||||
+ displayUrl),
|
.text = (tr::lng_open_this_link(tr::now)
|
||||||
.confirmed = [=] { Ui::hideLayer(); open(); },
|
+ qsl("\n\n")
|
||||||
.confirmText = tr::lng_open_link(),
|
+ displayUrl),
|
||||||
}),
|
.confirmed = [=](Fn<void()> hide) { hide(); open(); },
|
||||||
Ui::LayerOption::KeepOther);
|
.confirmText = tr::lng_open_link(),
|
||||||
|
}),
|
||||||
|
Ui::LayerOption::KeepOther);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
open();
|
open();
|
||||||
}
|
}
|
||||||
|
@ -150,16 +151,22 @@ void BotGameUrlClickHandler::onClick(ClickContext context) const {
|
||||||
|| _bot->session().local().isBotTrustedOpenGame(_bot->id)) {
|
|| _bot->session().local().isBotTrustedOpenGame(_bot->id)) {
|
||||||
open();
|
open();
|
||||||
} else {
|
} else {
|
||||||
const auto callback = [=, bot = _bot] {
|
const auto my = context.other.value<ClickHandlerContext>();
|
||||||
Ui::hideLayer();
|
if (const auto controller = my.sessionWindow.get()) {
|
||||||
bot->session().local().markBotTrustedOpenGame(bot->id);
|
const auto callback = [=, bot = _bot](Fn<void()> close) {
|
||||||
open();
|
close();
|
||||||
};
|
bot->session().local().markBotTrustedOpenGame(bot->id);
|
||||||
Ui::show(Ui::MakeConfirmBox({
|
open();
|
||||||
.text = tr::lng_allow_bot_pass(tr::now, lt_bot_name, _bot->name),
|
};
|
||||||
.confirmed = callback,
|
controller->show(Ui::MakeConfirmBox({
|
||||||
.confirmText = tr::lng_allow_bot(),
|
.text = tr::lng_allow_bot_pass(
|
||||||
}));
|
tr::now,
|
||||||
|
lt_bot_name,
|
||||||
|
_bot->name),
|
||||||
|
.confirmed = callback,
|
||||||
|
.confirmText = tr::lng_allow_bot(),
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue