mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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(
|
void AboutBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
not_null<Main::Session*> session) {
|
std::shared_ptr<ChatHelpers::Show> show) {
|
||||||
constexpr auto kUrl = "https://promote.telegram.org"_cs;
|
constexpr auto kUrl = "https://promote.telegram.org"_cs;
|
||||||
|
|
||||||
box->setNoContentMargin(true);
|
box->setNoContentMargin(true);
|
||||||
|
|
||||||
|
const auto session = &show->session();
|
||||||
|
|
||||||
const auto content = box->verticalLayout().get();
|
const auto content = box->verticalLayout().get();
|
||||||
const auto levels = Data::LevelLimits(session)
|
const auto levels = Data::LevelLimits(session)
|
||||||
.channelRestrictSponsoredLevelMin();
|
.channelRestrictSponsoredLevelMin();
|
||||||
|
@ -101,7 +103,7 @@ void AboutBox(
|
||||||
st::channelEarnSemiboldLabel),
|
st::channelEarnSemiboldLabel),
|
||||||
padding);
|
padding);
|
||||||
Ui::AddSkip(content, st::channelEarnHistoryThreeSkip);
|
Ui::AddSkip(content, st::channelEarnHistoryThreeSkip);
|
||||||
content->add(
|
const auto label = content->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
content,
|
content,
|
||||||
std::move(about),
|
std::move(about),
|
||||||
|
@ -121,6 +123,7 @@ void AboutBox(
|
||||||
(g.left() - left->width()) / 2,
|
(g.left() - left->width()) / 2,
|
||||||
g.top() + st::channelEarnHistoryThreeSkip);
|
g.top() + st::channelEarnHistoryThreeSkip);
|
||||||
}, left->lifetime());
|
}, left->lifetime());
|
||||||
|
return label;
|
||||||
};
|
};
|
||||||
addEntry(
|
addEntry(
|
||||||
tr::lng_sponsored_revenued_info1_title(),
|
tr::lng_sponsored_revenued_info1_title(),
|
||||||
|
@ -144,10 +147,14 @@ void AboutBox(
|
||||||
lt_link,
|
lt_link,
|
||||||
tr::lng_settings_privacy_premium_link(
|
tr::lng_settings_privacy_premium_link(
|
||||||
) | rpl::map([=](QString t) {
|
) | rpl::map([=](QString t) {
|
||||||
return Ui::Text::Link(t, kUrl.utf16());
|
return Ui::Text::Link(std::move(t), u"internal:"_q);
|
||||||
}),
|
}),
|
||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
st::sponsoredAboutRemoveIcon);
|
st::sponsoredAboutRemoveIcon)->setClickHandlerFilter([=](
|
||||||
|
const auto &...) {
|
||||||
|
ShowPremiumPreviewBox(show, PremiumFeature::NoAds);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
}
|
}
|
||||||
|
@ -339,7 +346,7 @@ void ShowSponsored(
|
||||||
st::popupMenuWithIcons);
|
st::popupMenuWithIcons);
|
||||||
|
|
||||||
menu->addAction(tr::lng_sponsored_menu_revenued_about(tr::now), [=] {
|
menu->addAction(tr::lng_sponsored_menu_revenued_about(tr::now), [=] {
|
||||||
show->show(Box(AboutBox, &item->history()->session()));
|
show->show(Box(AboutBox, show));
|
||||||
}, &st::menuIconInfo);
|
}, &st::menuIconInfo);
|
||||||
|
|
||||||
menu->addAction(tr::lng_sponsored_menu_revenued_report(tr::now), [=] {
|
menu->addAction(tr::lng_sponsored_menu_revenued_report(tr::now), [=] {
|
||||||
|
@ -363,7 +370,7 @@ void ShowSponsored(
|
||||||
|
|
||||||
void ShowSponsoredAbout(std::shared_ptr<ChatHelpers::Show> show) {
|
void ShowSponsoredAbout(std::shared_ptr<ChatHelpers::Show> show) {
|
||||||
show->showBox(Box([=](not_null<Ui::GenericBox*> box) {
|
show->showBox(Box([=](not_null<Ui::GenericBox*> box) {
|
||||||
AboutBox(box, &show->session());
|
AboutBox(box, show);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue