Support expired state for allow-sharing request.

This commit is contained in:
John Preston
2026-02-24 17:46:00 +04:00
parent 2aae67cb81
commit e5804fb213
3 changed files with 9 additions and 2 deletions
+1
View File
@@ -1922,6 +1922,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_action_no_forwards_feature_copying" = "Copying messages";
"lng_action_no_forwards_accept" = "Accept";
"lng_action_no_forwards_reject" = "Reject";
"lng_action_no_forwards_request_expired" = "Sharing enable request has expired.";
"lng_manage_peer_bot_public_link" = "Public Link";
"lng_manage_peer_bot_public_links" = "Public Links";
@@ -6707,7 +6707,12 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
auto prepareNoForwardsRequest = [this](const MTPDmessageActionNoForwardsRequest &action) {
auto result = PreparedServiceText();
if (_from->isSelf()) {
const auto nfr = Get<HistoryServiceNoForwardsRequest>();
if (nfr && nfr->expired) {
result.text = tr::lng_action_no_forwards_request_expired(
tr::now,
tr::marked);
} else if (_from->isSelf()) {
result.text = tr::lng_action_no_forwards_request_you(
tr::now,
tr::marked);
@@ -1544,7 +1544,8 @@ void Element::refreshMedia(Element *replacing) {
this,
std::make_unique<LargeEmoji>(this, emoji));
}
} else if (const auto nfr = item->Get<HistoryServiceNoForwardsRequest>()) {
} else if (const auto nfr = item->Get<HistoryServiceNoForwardsRequest>()
; nfr && !nfr->expired) {
_media = std::make_unique<MediaGeneric>(
this,
GenerateNoForwardsRequestMedia(this, nfr),