diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index a34355415..70a80491c 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -1450,11 +1450,6 @@ void RepliesWidget::saveState(not_null memento) { void RepliesWidget::restoreState(not_null memento) { const auto setReplies = [&](std::shared_ptr replies) { _replies = std::move(replies); - _replies->fullCount( - ) | rpl::take(1) | rpl::start_with_next([=] { - _loaded = true; - updatePinnedVisibility(); - }, lifetime()); rpl::combine( rpl::single(0) | rpl::then(_replies->fullCount()), @@ -1663,7 +1658,18 @@ rpl::producer RepliesWidget::listSource( Data::MessagePosition aroundId, int limitBefore, int limitAfter) { - return _replies->source(aroundId, limitBefore, limitAfter); + return _replies->source( + aroundId, + limitBefore, + limitAfter + ) | rpl::before_next([=] { // after_next makes a copy of value. + if (!_loaded) { + _loaded = true; + crl::on_main(this, [=] { + updatePinnedVisibility(); + }); + } + }); } bool RepliesWidget::listAllowsMultiSelect() { diff --git a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp index e00a4c01c..6ea53e0ca 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp @@ -155,7 +155,7 @@ QSize Gif::countOptimalSize() { _thumbh = th; auto maxWidth = qMax(tw, st::minPhotoSize); auto minHeight = qMax(th, st::minPhotoSize); - accumulate_max(maxWidth, _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x())); + accumulate_max(maxWidth, _parent->minWidthForMedia()); if (!activeCurrentStreamed()) { accumulate_max(maxWidth, gifMaxStatusWidth(_data) + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x())); } @@ -212,7 +212,7 @@ QSize Gif::countCurrentSize(int newWidth) { newWidth = qMax(tw, st::minPhotoSize); auto newHeight = qMax(th, st::minPhotoSize); - accumulate_max(newWidth, _parent->infoWidth() + 2 * st::msgDateImgDelta + st::msgDateImgPadding.x()); + accumulate_max(newWidth, _parent->minWidthForMedia()); if (!activeCurrentStreamed()) { accumulate_max(newWidth, gifMaxStatusWidth(_data) + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x())); } diff --git a/Telegram/lib_rpl b/Telegram/lib_rpl index 86b9b80fa..e1b96399d 160000 --- a/Telegram/lib_rpl +++ b/Telegram/lib_rpl @@ -1 +1 @@ -Subproject commit 86b9b80fae7a41e7c6ad85f14659883533ab84e8 +Subproject commit e1b96399d9031c4ef0354631e6bb375029d29d9f