Skip to content

Commit

Permalink
Fix switching profiles in a channel.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Aug 15, 2024
1 parent a4ac00a commit 3a7a485
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions Telegram/SourceFiles/history/view/history_view_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4232,28 +4232,35 @@ int Message::resizeContentGetHeight(int newWidth) {
return height();
}

const auto item = data();
const auto postShowingAuthor = item->isPostShowingAuthor() ? 1 : 0;
if (_postShowingAuthor != postShowingAuthor) {
_postShowingAuthor = postShowingAuthor;
_fromNameVersion = -1;
previousInBlocksChanged();

const auto size = _bottomInfo.currentSize();
_bottomInfo.update(BottomInfoDataFromMessage(this), newWidth);
if (size != _bottomInfo.currentSize()) {
// maxWidth may have changed, full recount required.
setPendingResize();
return resizeGetHeight(newWidth);
}
}

auto newHeight = minHeight();

if (const auto service = Get<ServicePreMessage>()) {
service->resizeToWidth(newWidth, delegate()->elementIsChatWide());
}

const auto item = data();
const auto botTop = item->isFakeAboutView()
? Get<FakeBotAboutTop>()
: nullptr;
const auto media = this->media();
const auto mediaDisplayed = media ? media->isDisplayed() : false;
const auto bubble = drawBubble();

const auto postShowingAuthor = item->isPostShowingAuthor() ? 1 : 0;
if (_postShowingAuthor != postShowingAuthor) {
_postShowingAuthor = postShowingAuthor;
_bottomInfo.update(BottomInfoDataFromMessage(this), newWidth);
_fromNameVersion = -1;
previousInBlocksChanged();
}

item->resolveDependent();

// This code duplicates countGeometry() but also resizes media.
Expand Down

0 comments on commit 3a7a485

Please sign in to comment.