mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix searching with "from:" prefix.
This commit is contained in:
parent
583bcca6a9
commit
701bf0d553
1 changed files with 6 additions and 4 deletions
|
@ -2881,6 +2881,12 @@ bool Widget::applySearchState(SearchState state) {
|
||||||
state.inChat = session().data().history(session().user());
|
state.inChat = session().data().history(session().user());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto clearQuery = state.fromPeer
|
||||||
|
&& (_lastSearchText == HistoryView::SwitchToChooseFromQuery());
|
||||||
|
if (clearQuery) {
|
||||||
|
state.query = _lastSearchText = QString();
|
||||||
|
}
|
||||||
|
|
||||||
const auto inChatChanged = (_searchState.inChat != state.inChat);
|
const auto inChatChanged = (_searchState.inChat != state.inChat);
|
||||||
const auto fromPeerChanged = (_searchState.fromPeer != state.fromPeer);
|
const auto fromPeerChanged = (_searchState.fromPeer != state.fromPeer);
|
||||||
const auto tagsChanged = (_searchState.tags != state.tags);
|
const auto tagsChanged = (_searchState.tags != state.tags);
|
||||||
|
@ -2962,10 +2968,6 @@ bool Widget::applySearchState(SearchState state) {
|
||||||
_subsectionTopBar->searchEnableJumpToDate(
|
_subsectionTopBar->searchEnableJumpToDate(
|
||||||
_openedForum && _searchState.inChat);
|
_openedForum && _searchState.inChat);
|
||||||
}
|
}
|
||||||
if (_searchState.fromPeer
|
|
||||||
&& _lastSearchText == HistoryView::SwitchToChooseFromQuery()) {
|
|
||||||
cancelSearch();
|
|
||||||
}
|
|
||||||
if (!_searchState.inChat && _searchState.query.isEmpty()) {
|
if (!_searchState.inChat && _searchState.query.isEmpty()) {
|
||||||
setInnerFocus();
|
setInnerFocus();
|
||||||
} else if (!_subsectionTopBar || !_subsectionTopBar->searchSetFocus()) {
|
} else if (!_subsectionTopBar || !_subsectionTopBar->searchSetFocus()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue