Fix preview messages load in migrated groups.

This commit is contained in:
John Preston 2024-06-13 18:43:58 +04:00
parent e47e4ba338
commit 273119fc55
1 changed files with 6 additions and 2 deletions

View File

@ -577,8 +577,12 @@ MessagesBarData Item::listMessagesBar(
? _replies->computeInboxReadTillFull()
: MsgId();
const auto migrated = _replies ? nullptr : _history->migrateFrom();
const auto migratedTill = migrated ? migrated->inboxReadTillId() : 0;
const auto historyTill = _replies ? 0 : _history->inboxReadTillId();
const auto migratedTill = (migrated && migrated->unreadCount() > 0)
? migrated->inboxReadTillId()
: 0;
const auto historyTill = (_replies || !_history->unreadCount())
? 0
: _history->inboxReadTillId();
if (!_replies && !migratedTill && !historyTill) {
return {};
}