2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Add scroll-to-down button to Feed.

This commit is contained in:
John Preston
2018-02-04 22:57:03 +03:00
parent b8614c60f9
commit 11671e85da
11 changed files with 349 additions and 15 deletions

View File

@@ -1833,15 +1833,23 @@ void DialogsInner::peerSearchReceived(
return;
}
const auto alreadyAdded = [&](not_null<PeerData*> peer) {
for (const auto &row : _filterResults) {
if (const auto history = row->history()) {
if (history->peer == peer) {
return true;
}
}
}
return false;
};
_peerSearchQuery = query.toLower().trimmed();
_peerSearchResults.clear();
_peerSearchResults.reserve(result.size());
for (const auto &mtpPeer : my) {
if (const auto peer = App::peerLoaded(peerFromMTP(mtpPeer))) {
if (const auto history = App::historyLoaded(peer)) {
if (history->inChatList(Dialogs::Mode::All)) {
continue; // skip existing chats
}
if (alreadyAdded(peer)) {
continue;
}
const auto prev = nullptr, next = nullptr;
const auto position = 0;