MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / searchMessages

Method searchMessages

Telegram/SourceFiles/dialogs/dialogs_widget.cpp:2864–2893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2862}
2863
2864void Widget::searchMessages(SearchState state) {
2865 if (const auto peer = state.inChat.peer()) {
2866 if (_openedForum && peer->forum() != _openedForum) {
2867 controller()->closeForum();
2868 }
2869 } else if (state.query.isEmpty()) {
2870 if (_childList) {
2871 hideChildList();
2872 }
2873 if (_openedForum) {
2874 controller()->closeForum();
2875 }
2876 if (_layout == Layout::Main) {
2877 controller()->closeFolder();
2878 }
2879 }
2880 applySearchState(std::move(state));
2881 session().local().saveRecentSearchHashtags(_searchState.query);
2882
2883 if (_childList) {
2884 _childList->setInnerFocus();
2885 } else if (_subsectionTopBar) {
2886 if (!_subsectionTopBar->searchSetFocus()
2887 && !_subsectionTopBar->searchHasFocus()) {
2888 _subsectionTopBar->toggleSearch(true, anim::type::normal);
2889 }
2890 } else {
2891 _search->setFocus();
2892 }
2893}
2894
2895void Widget::searchTopics() {
2896 if (_topicSearchRequest || _topicSearchFull) {

Callers 8

MessagesCountValueFunction · 0.45
SearchByHashtagFunction · 0.45
FocusSearchFunction · 0.45
listSearchMethod · 0.45
elementSearchInListMethod · 0.45
listSearchMethod · 0.45
listSearchMethod · 0.45
listSearchMethod · 0.45

Calls 11

closeForumMethod · 0.80
closeFolderMethod · 0.80
searchSetFocusMethod · 0.80
peerMethod · 0.45
forumMethod · 0.45
isEmptyMethod · 0.45
setInnerFocusMethod · 0.45
searchHasFocusMethod · 0.45
toggleSearchMethod · 0.45
setFocusMethod · 0.45

Tested by

no test coverage detected