Merge tag 'v5.14.3' into dev

This commit is contained in:
AlexeyZavar
2025-05-18 22:30:12 +03:00
164 changed files with 4335 additions and 1121 deletions
@@ -109,8 +109,8 @@ constexpr auto kSearchRequestDelay = crl::time(900);
base::options::toggle OptionForumHideChatsList({
.id = kOptionForumHideChatsList,
.name = "Hide chats list in forums",
.description = "Don't keep a narrow column of chats list.",
.name = "Hide chat list in forums",
.description = "Don't keep a narrow column of chat list.",
});
[[nodiscard]] bool RedirectTextToSearch(const QString &text) {
@@ -2528,7 +2528,19 @@ bool Widget::search(bool inCache, SearchRequestDelay delay) {
};
if (trimmed.isEmpty() && !fromPeer && inTags.empty()) {
cancelSearchRequest();
// Otherwise inside first searchApplyEmpty we call searchMode(),
// which tries to load migrated search results for empty query.
_migratedProcess.full = true;
searchApplyEmpty(fromStartType, currentSearchProcess());
if (_searchInMigrated) {
const auto type = SearchRequestType{
.migrated = true,
.start = true,
};
searchApplyEmpty(type, &_migratedProcess);
}
if (_searchWithPostsPreview) {
searchApplyEmpty(
{ .posts = true, .start = true },
@@ -2950,7 +2962,8 @@ auto Widget::currentSearchProcess() -> not_null<SearchProcessState*> {
bool Widget::computeSearchWithPostsPreview() const {
return (_searchHashOrCashtag != HashOrCashtag::None)
&& (_searchState.tab == ChatSearchTab::MyMessages);
&& (_searchState.tab == ChatSearchTab::MyMessages)
&& !_searchState.inChat;
}
void Widget::searchReceived(
@@ -3488,7 +3501,9 @@ bool Widget::applySearchState(SearchState state) {
: ChatSearchTab::MyMessages;
}
const auto migrateFrom = (peer && !topic)
const auto migrateFrom = (peer
&& !topic
&& state.tab == ChatSearchTab::ThisPeer)
? peer->migrateFrom()
: nullptr;
_searchInMigrated = migrateFrom