2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Search single messages by message link.

This commit is contained in:
John Preston
2019-08-06 15:43:26 +01:00
parent 230dd29af5
commit 10e28913ca
10 changed files with 391 additions and 74 deletions

View File

@@ -2000,6 +2000,7 @@ bool InnerWidget::hasHistoryInResults(not_null<History*> history) const {
bool InnerWidget::searchReceived(
const QVector<MTPMessage> &messages,
HistoryItem *inject,
SearchRequestType type,
int fullCount) {
const auto uniquePeers = uniqueSearchResults();
@@ -2010,6 +2011,16 @@ bool InnerWidget::searchReceived(
auto isMigratedSearch = (type == SearchRequestType::MigratedFromStart || type == SearchRequestType::MigratedFromOffset);
TimeId lastDateFound = 0;
if (inject
&& (!_searchInChat
|| inject->history() == _searchInChat.history())) {
Assert(_searchResults.empty());
_searchResults.push_back(
std::make_unique<FakeRow>(
_searchInChat,
inject));
++fullCount;
}
for (const auto &message : messages) {
auto msgId = IdFromMessage(message);
auto peerId = PeerFromMessage(message);