Attempted to fix rare non-elided text in bar of pinned bot messages.

This commit is contained in:
23rd 2022-09-01 23:29:41 +03:00 committed by John Preston
parent fa6b4f9b52
commit 49773dde72

View file

@ -6417,8 +6417,7 @@ void HistoryWidget::checkPinnedBarState() {
return controller()->isGifPausedAtLeastFor(
Window::GifPauseReason::Any);
});
rpl::combine(
Info::Profile::SharedMediaCountValue(
auto pinnedRefreshed = Info::Profile::SharedMediaCountValue(
_peer,
nullptr,
Storage::SharedMediaType::Pinned
@ -6430,18 +6429,27 @@ void HistoryWidget::checkPinnedBarState() {
updatePinnedViewer();
}
return (count > 1);
}) | rpl::distinct_until_changed(),
HistoryView::PinnedBarItemWithReplyMarkup(
}) | rpl::distinct_until_changed();
auto markupRefreshed = HistoryView::PinnedBarItemWithReplyMarkup(
&session(),
_pinnedTracker->shownMessageId())
_pinnedTracker->shownMessageId());
rpl::combine(
rpl::duplicate(pinnedRefreshed),
rpl::duplicate(markupRefreshed)
) | rpl::start_with_next([=](bool many, HistoryItem *item) {
refreshPinnedBarButton(many, item);
}, _pinnedBar->lifetime());
_pinnedBar->setContent(HistoryView::PinnedBarContent(
_pinnedBar->setContent(rpl::combine(
HistoryView::PinnedBarContent(
&session(),
_pinnedTracker->shownMessageId(),
[bar = _pinnedBar.get()] { bar->customEmojiRepaint(); }));
[bar = _pinnedBar.get()] { bar->customEmojiRepaint(); }),
std::move(pinnedRefreshed),
std::move(markupRefreshed)
) | rpl::map([](Ui::MessageBarContent &&content, bool, HistoryItem*) {
return std::move(content);
}));
controller()->adaptive().oneColumnValue(
) | rpl::start_with_next([=](bool one) {