2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 15:35:51 +00:00

Support hashtags with mentions.

This commit is contained in:
John Preston
2024-10-11 09:31:03 +04:00
parent f89aeb6ad4
commit 7ee2e3d8bc
6 changed files with 42 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_history_hider.h"
#include "window/window_controller.h"
#include "window/window_peer_menu.h"
#include "window/window_session_controller_link_info.h"
#include "window/themes/window_theme.h"
#include "chat_helpers/bot_command.h"
#include "chat_helpers/tabbed_selector.h" // TabbedSelector::refreshStickers
@@ -744,6 +745,15 @@ void MainWidget::hideSingleUseKeyboard(FullMsgId replyToId) {
}
void MainWidget::searchMessages(const QString &query, Dialogs::Key inChat) {
const auto complex = Data::HashtagWithUsernameFromQuery(query);
if (!complex.username.isEmpty()) {
_controller->showPeerByLink(Window::PeerByLinkInfo{
.usernameOrId = complex.username,
.text = complex.hashtag,
.resolveType = Window::ResolveType::HashtagSearch,
});
return;
}
auto tags = Data::SearchTagsFromQuery(query);
if (_dialogs) {
auto state = Dialogs::SearchState{