diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 2b72afa..59799c5 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -5929,6 +5929,23 @@ int Message::minWidthForMedia() const { if (const auto keyboard = inlineReplyKeyboard()) { accumulate_max(result, keyboard->naturalWidth()); } + if (Has() && displayFromName() && drawBubble()) { + const auto from = displayFrom(); + validateFromNameText(from); + const auto &name = from + ? _fromName + : data()->displayHiddenSenderInfo()->nameText(); + accumulate_max( + result, + st::msgPadding.left() + + name.maxWidth() + + (_fromNameStatus + ? st::dialogsPremiumIcon.icon.width() + : 0) + + st::msgPadding.right() + + st::msgPadding.right() + + rightBadgeWidth()); + } return result; }