mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 22:57:11 +02:00
Added divider text to box for reporting of sponsored messages.
This commit is contained in:
parent
1a7a906ced
commit
586983eb9b
2 changed files with 19 additions and 3 deletions
|
@ -1578,6 +1578,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_report_sponsored_hidden" = "Sponsored messages will be hidden.";
|
||||
"lng_report_sponsored_reported" = "We will review this ad to ensure it matches out {link}.";
|
||||
"lng_report_sponsored_reported_link" = "Ad Policies and Guidelines";
|
||||
"lng_report_sponsored_reported_learn" = "Learn more about our {link}.";
|
||||
|
||||
"lng_channel_add_members" = "Add members";
|
||||
"lng_channel_add_users" = "Add users";
|
||||
|
|
|
@ -219,6 +219,9 @@ void ShowReportSponsoredBox(
|
|||
auto &sponsoredMessages = peer->session().data().sponsoredMessages();
|
||||
const auto fullId = item->fullId();
|
||||
const auto report = sponsoredMessages.createReportCallback(fullId);
|
||||
const auto guideLink = Ui::Text::Link(
|
||||
tr::lng_report_sponsored_reported_link(tr::now),
|
||||
u"https://promote.telegram.org/guidelines"_q);
|
||||
|
||||
auto performRequest = [=](
|
||||
const auto &repeatRequest,
|
||||
|
@ -245,6 +248,20 @@ void ShowReportSponsoredBox(
|
|||
box->addLeftButton(
|
||||
tr::lng_create_group_back(),
|
||||
[=] { box->closeBox(); });
|
||||
} else {
|
||||
const auto container = box->verticalLayout();
|
||||
Ui::AddSkip(container);
|
||||
container->add(object_ptr<Ui::DividerLabel>(
|
||||
container,
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
container,
|
||||
tr::lng_report_sponsored_reported_learn(
|
||||
lt_link,
|
||||
rpl::single(guideLink),
|
||||
Ui::Text::WithEntities),
|
||||
st::boxDividerLabel),
|
||||
st::defaultBoxDividerLabelPadding,
|
||||
RectPart::Top | RectPart::Bottom));
|
||||
}
|
||||
box->addButton(
|
||||
tr::lng_close(),
|
||||
|
@ -259,9 +276,7 @@ void ShowReportSponsoredBox(
|
|||
auto text = tr::lng_report_sponsored_reported(
|
||||
tr::now,
|
||||
lt_link,
|
||||
Ui::Text::Link(
|
||||
tr::lng_report_sponsored_reported_link(tr::now),
|
||||
u"https://promote.telegram.org/guidelines"_q),
|
||||
guideLink,
|
||||
Ui::Text::WithEntities);
|
||||
show->showToast({ .text = std::move(text) });
|
||||
} break;
|
||||
|
|
Loading…
Add table
Reference in a new issue