Fix switching profiles in a channel.

This commit is contained in:
John Preston 2024-08-15 10:45:55 +02:00
parent a4ac00acbd
commit 3a7a485dd0

View file

@ -4232,13 +4232,28 @@ 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;
@ -4246,14 +4261,6 @@ int Message::resizeContentGetHeight(int newWidth) {
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.