2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Suggest global search of cashtags.

This commit is contained in:
John Preston
2024-06-27 16:55:19 +04:00
parent 631d6abb06
commit 09e6077e97
6 changed files with 52 additions and 28 deletions

View File

@@ -2655,7 +2655,7 @@ void InnerWidget::applySearchState(SearchState state) {
onHashtagFilterUpdate(QStringView());
}
_searchState = std::move(state);
_searchingHashtag = IsHashtagSearchQuery(_searchState.query);
_searchHashOrCashtag = IsHashOrCashtagSearchQuery(_searchState.query);
updateSearchIn();
moveSearchIn();
@@ -3332,7 +3332,8 @@ auto InnerWidget::searchTagsChanges() const
}
void InnerWidget::updateSearchIn() {
if (!_searchState.inChat && !_searchingHashtag) {
if (!_searchState.inChat
&& _searchHashOrCashtag == HashOrCashtag::None) {
_searchIn = nullptr;
return;
} else if (!_searchIn) {
@@ -3381,7 +3382,7 @@ void InnerWidget::updateSearchIn() {
? Ui::MakeUserpicThumbnail(sublist->peer())
: nullptr;
const auto myIcon = Ui::MakeIconThumbnail(st::menuIconChats);
const auto publicIcon = _searchingHashtag
const auto publicIcon = (_searchHashOrCashtag != HashOrCashtag::None)
? Ui::MakeIconThumbnail(st::menuIconChannel)
: nullptr;
const auto peerTabType = (peer && peer->isBroadcast())