mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 06:55:58 +00:00
Fix empty query migrated group search.
This commit is contained in:
@@ -2520,7 +2520,19 @@ bool Widget::search(bool inCache, SearchRequestDelay delay) {
|
|||||||
};
|
};
|
||||||
if (trimmed.isEmpty() && !fromPeer && inTags.empty()) {
|
if (trimmed.isEmpty() && !fromPeer && inTags.empty()) {
|
||||||
cancelSearchRequest();
|
cancelSearchRequest();
|
||||||
|
|
||||||
|
// Otherwise inside first searchApplyEmpty we call searchMode(),
|
||||||
|
// which tries to load migrated search results for empty query.
|
||||||
|
_migratedProcess.full = true;
|
||||||
|
|
||||||
searchApplyEmpty(fromStartType, currentSearchProcess());
|
searchApplyEmpty(fromStartType, currentSearchProcess());
|
||||||
|
if (_searchInMigrated) {
|
||||||
|
const auto type = SearchRequestType{
|
||||||
|
.migrated = true,
|
||||||
|
.start = true,
|
||||||
|
};
|
||||||
|
searchApplyEmpty(type, &_migratedProcess);
|
||||||
|
}
|
||||||
if (_searchWithPostsPreview) {
|
if (_searchWithPostsPreview) {
|
||||||
searchApplyEmpty(
|
searchApplyEmpty(
|
||||||
{ .posts = true, .start = true },
|
{ .posts = true, .start = true },
|
||||||
@@ -3481,7 +3493,9 @@ bool Widget::applySearchState(SearchState state) {
|
|||||||
: ChatSearchTab::MyMessages;
|
: ChatSearchTab::MyMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto migrateFrom = (peer && !topic)
|
const auto migrateFrom = (peer
|
||||||
|
&& !topic
|
||||||
|
&& state.tab == ChatSearchTab::ThisPeer)
|
||||||
? peer->migrateFrom()
|
? peer->migrateFrom()
|
||||||
: nullptr;
|
: nullptr;
|
||||||
_searchInMigrated = migrateFrom
|
_searchInMigrated = migrateFrom
|
||||||
|
Reference in New Issue
Block a user