mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 00:46:08 +00:00
Implement a special context menu for sender userpic.
This commit is contained in:
@@ -744,7 +744,10 @@ void MainWidget::hideSingleUseKeyboard(FullMsgId replyToId) {
|
||||
_history->hideSingleUseKeyboard(replyToId);
|
||||
}
|
||||
|
||||
void MainWidget::searchMessages(const QString &query, Dialogs::Key inChat) {
|
||||
void MainWidget::searchMessages(
|
||||
const QString &query,
|
||||
Dialogs::Key inChat,
|
||||
PeerData *searchFrom) {
|
||||
const auto complex = Data::HashtagWithUsernameFromQuery(query);
|
||||
if (!complex.username.isEmpty()) {
|
||||
_controller->showPeerByLink(Window::PeerByLinkInfo{
|
||||
@@ -760,6 +763,7 @@ void MainWidget::searchMessages(const QString &query, Dialogs::Key inChat) {
|
||||
.inChat = ((tags.empty() || inChat.sublist())
|
||||
? inChat
|
||||
: session().data().history(session().user())),
|
||||
.fromPeer = inChat ? searchFrom : nullptr,
|
||||
.tags = tags,
|
||||
.query = tags.empty() ? query : QString(),
|
||||
};
|
||||
@@ -779,12 +783,15 @@ void MainWidget::searchMessages(const QString &query, Dialogs::Key inChat) {
|
||||
controller()->session().user());
|
||||
}
|
||||
if ((!_mainSection
|
||||
|| !_mainSection->searchInChatEmbedded(inChat, query))
|
||||
&& !_history->searchInChatEmbedded(inChat, query)) {
|
||||
|| !_mainSection->searchInChatEmbedded(query, inChat, searchFrom))
|
||||
&& !_history->searchInChatEmbedded(query, inChat, searchFrom)) {
|
||||
const auto account = not_null(&session().account());
|
||||
if (const auto window = Core::App().windowFor(account)) {
|
||||
if (const auto controller = window->sessionController()) {
|
||||
controller->content()->searchMessages(query, inChat);
|
||||
controller->content()->searchMessages(
|
||||
query,
|
||||
inChat,
|
||||
searchFrom);
|
||||
controller->widget()->activate();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user