Fix two bugs with supergroup history disappearing.
This commit is contained in:
parent
81f9c70279
commit
53219bcf70
|
@ -2135,7 +2135,11 @@ void History::getReadyFor(MsgId msgId) {
|
||||||
}
|
}
|
||||||
if (!isReadyFor(msgId)) {
|
if (!isReadyFor(msgId)) {
|
||||||
unloadBlocks();
|
unloadBlocks();
|
||||||
|
if (const auto migratePeer = peer->migrateFrom()) {
|
||||||
|
if (const auto migrated = App::historyLoaded(migratePeer)) {
|
||||||
|
migrated->unloadBlocks();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (msgId == ShowAtTheEndMsgId) {
|
if (msgId == ShowAtTheEndMsgId) {
|
||||||
_loadedAtBottom = true;
|
_loadedAtBottom = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1945,7 +1945,7 @@ void HistoryInner::recountHistoryGeometry() {
|
||||||
if (_migrated->blocks.back()->messages.back()->dateTime().date() == _history->blocks.front()->messages.front()->dateTime().date()) {
|
if (_migrated->blocks.back()->messages.back()->dateTime().date() == _history->blocks.front()->messages.front()->dateTime().date()) {
|
||||||
if (_migrated->blocks.back()->messages.back()->data()->isGroupMigrate() && _history->blocks.front()->messages.front()->data()->isGroupMigrate()) {
|
if (_migrated->blocks.back()->messages.back()->data()->isGroupMigrate() && _history->blocks.front()->messages.front()->data()->isGroupMigrate()) {
|
||||||
_historySkipHeight += _history->blocks.front()->messages.front()->height();
|
_historySkipHeight += _history->blocks.front()->messages.front()->height();
|
||||||
} else {
|
} else if (_migrated->height() > _history->blocks.front()->messages.front()->displayedDateHeight()) {
|
||||||
_historySkipHeight += _history->blocks.front()->messages.front()->displayedDateHeight();
|
_historySkipHeight += _history->blocks.front()->messages.front()->displayedDateHeight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue