Removed text commands from url auth box.

This commit is contained in:
23rd 2021-12-25 20:42:43 +03:00 committed by John Preston
parent 97dde7eb56
commit d6801517bb

View file

@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h"
#include "data/data_user.h"
#include "core/click_handler_types.h"
#include "ui/text/text_utilities.h"
#include "ui/wrap/vertical_layout.h"
#include "ui/widgets/checkbox.h"
#include "ui/widgets/labels.h"
@ -255,11 +256,11 @@ not_null<Ui::RpWidget*> UrlAuthBox::setupContent(
tr::lng_url_auth_open_confirm(tr::now, lt_link, url),
st::boxLabel),
st::boxPadding);
const auto addCheckbox = [&](const QString &text) {
const auto addCheckbox = [&](const TextWithEntities &text) {
const auto checkbox = result->add(
object_ptr<Ui::Checkbox>(
result,
QString(),
text,
true,
st::urlAuthCheckbox),
style::margins(
@ -268,23 +269,22 @@ not_null<Ui::RpWidget*> UrlAuthBox::setupContent(
st::boxPadding.right(),
st::boxPadding.bottom()));
checkbox->setAllowTextLines();
checkbox->setText(text, true);
return checkbox;
};
const auto auth = addCheckbox(
tr::lng_url_auth_login_option(
tr::now,
lt_domain,
textcmdStartSemibold() + domain + textcmdStopSemibold(),
Ui::Text::Bold(domain),
lt_user,
(textcmdStartSemibold()
+ session->user()->name
+ textcmdStopSemibold())));
Ui::Text::Bold(session->user()->name),
Ui::Text::WithEntities));
const auto allow = bot
? addCheckbox(tr::lng_url_auth_allow_messages(
tr::now,
lt_bot,
textcmdStartSemibold() + bot->firstName + textcmdStopSemibold()))
Ui::Text::Bold(bot->firstName),
Ui::Text::WithEntities))
: nullptr;
if (allow) {
rpl::single(