mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Fixed link to premium section in box about sponsored messages.
This commit is contained in:
parent
e4323ecd26
commit
76137ca1cf
1 changed files with 13 additions and 6 deletions
|
@ -37,11 +37,13 @@ namespace {
|
|||
|
||||
void AboutBox(
|
||||
not_null<Ui::GenericBox*> box,
|
||||
not_null<Main::Session*> session) {
|
||||
std::shared_ptr<ChatHelpers::Show> show) {
|
||||
constexpr auto kUrl = "https://promote.telegram.org"_cs;
|
||||
|
||||
box->setNoContentMargin(true);
|
||||
|
||||
const auto session = &show->session();
|
||||
|
||||
const auto content = box->verticalLayout().get();
|
||||
const auto levels = Data::LevelLimits(session)
|
||||
.channelRestrictSponsoredLevelMin();
|
||||
|
@ -101,7 +103,7 @@ void AboutBox(
|
|||
st::channelEarnSemiboldLabel),
|
||||
padding);
|
||||
Ui::AddSkip(content, st::channelEarnHistoryThreeSkip);
|
||||
content->add(
|
||||
const auto label = content->add(
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
content,
|
||||
std::move(about),
|
||||
|
@ -121,6 +123,7 @@ void AboutBox(
|
|||
(g.left() - left->width()) / 2,
|
||||
g.top() + st::channelEarnHistoryThreeSkip);
|
||||
}, left->lifetime());
|
||||
return label;
|
||||
};
|
||||
addEntry(
|
||||
tr::lng_sponsored_revenued_info1_title(),
|
||||
|
@ -144,10 +147,14 @@ void AboutBox(
|
|||
lt_link,
|
||||
tr::lng_settings_privacy_premium_link(
|
||||
) | rpl::map([=](QString t) {
|
||||
return Ui::Text::Link(t, kUrl.utf16());
|
||||
return Ui::Text::Link(std::move(t), u"internal:"_q);
|
||||
}),
|
||||
Ui::Text::RichLangValue),
|
||||
st::sponsoredAboutRemoveIcon);
|
||||
st::sponsoredAboutRemoveIcon)->setClickHandlerFilter([=](
|
||||
const auto &...) {
|
||||
ShowPremiumPreviewBox(show, PremiumFeature::NoAds);
|
||||
return true;
|
||||
});
|
||||
Ui::AddSkip(content);
|
||||
Ui::AddSkip(content);
|
||||
}
|
||||
|
@ -339,7 +346,7 @@ void ShowSponsored(
|
|||
st::popupMenuWithIcons);
|
||||
|
||||
menu->addAction(tr::lng_sponsored_menu_revenued_about(tr::now), [=] {
|
||||
show->show(Box(AboutBox, &item->history()->session()));
|
||||
show->show(Box(AboutBox, show));
|
||||
}, &st::menuIconInfo);
|
||||
|
||||
menu->addAction(tr::lng_sponsored_menu_revenued_report(tr::now), [=] {
|
||||
|
@ -363,7 +370,7 @@ void ShowSponsored(
|
|||
|
||||
void ShowSponsoredAbout(std::shared_ptr<ChatHelpers::Show> show) {
|
||||
show->showBox(Box([=](not_null<Ui::GenericBox*> box) {
|
||||
AboutBox(box, &show->session());
|
||||
AboutBox(box, show);
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue