diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index fa39bbe469..734a93e453 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2280,6 +2280,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_action_suggest_success_ton#other" = "{from} has received {count} TON for publishing post."; "lng_action_suggest_refund_user" = "User refunded the Stars so that post was deleted."; "lng_action_suggest_refund_admin" = "Admin deleted the post early so that the price was refunded to the user."; +"lng_action_post_rejected" = "The post was rejected."; +"lng_action_not_enough_funds" = "Transaction failed."; "lng_you_paid_stars#one" = "You paid {count} Star."; "lng_you_paid_stars#other" = "You paid {count} Stars."; diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index e614103c9b..691661d8c0 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -6087,7 +6087,11 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { }; auto prepareSuggestedPostApproval = [&](const MTPDmessageActionSuggestedPostApproval &data) { - return PreparedServiceText{ { tr::lng_suggest_action_agreement(tr::now) } }; + return PreparedServiceText{ { data.is_rejected() + ? tr::lng_action_post_rejected(tr::now) + : data.is_balance_too_low() + ? tr::lng_action_not_enough_funds(tr::now) + : tr::lng_suggest_action_agreement(tr::now) } }; }; auto prepareSuggestedPostSuccess = [&](const MTPDmessageActionSuggestedPostSuccess &data) { diff --git a/Telegram/SourceFiles/history/view/media/history_view_media_generic.cpp b/Telegram/SourceFiles/history/view/media/history_view_media_generic.cpp index 8f1629f8fd..37b9a3b4ed 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_media_generic.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_media_generic.cpp @@ -322,13 +322,19 @@ QSize MediaGenericTextPart::countOptimalSize() { QSize MediaGenericTextPart::countCurrentSize(int newWidth) { auto skip = _margins.left() + _margins.right(); - const auto size = CountOptimalTextSize( - _text, - st::msgMinWidth, - std::max(st::msgMinWidth, newWidth - skip)); + const auto size = (_align == style::al_top) + ? CountOptimalTextSize( + _text, + st::msgMinWidth, + std::max(st::msgMinWidth, newWidth - skip)) + : QSize(newWidth - skip, _text.countHeight(newWidth - skip)); + const auto lines = elisionLines(); + const auto height = lines + ? std::min(size.height(), lines * _text.style()->font->height) + : size.height(); return { size.width() + skip, - _margins.top() + size.height() + _margins.bottom(), + _margins.top() + height + _margins.bottom(), }; }