2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Add calls log box.

PeerListBox can have many rows with the same PeerData.
PeerListBox::Row can have arbitrary action on the right side.
This commit is contained in:
John Preston
2017-04-27 22:04:45 +03:00
parent f6eb2c5205
commit 06b081f509
26 changed files with 709 additions and 165 deletions

View File

@@ -1504,31 +1504,28 @@ bool DialogsInner::searchReceived(const QVector<MTPMessage> &messages, DialogsSe
TimeId lastDateFound = 0;
for_const (auto message, messages) {
if (auto msgId = idFromMessage(message)) {
auto peerId = peerFromMessage(message);
auto lastDate = dateFromMessage(message);
if (auto peer = App::peerLoaded(peerId)) {
if (lastDate) {
auto item = App::histories().addNewMessage(message, NewMessageExisting);
_searchResults.push_back(std::make_unique<Dialogs::FakeRow>(item));
lastDateFound = lastDate;
if (isGlobalSearch) {
_lastSearchDate = lastDateFound;
}
}
auto msgId = idFromMessage(message);
auto peerId = peerFromMessage(message);
auto lastDate = dateFromMessage(message);
if (auto peer = App::peerLoaded(peerId)) {
if (lastDate) {
auto item = App::histories().addNewMessage(message, NewMessageExisting);
_searchResults.push_back(std::make_unique<Dialogs::FakeRow>(item));
lastDateFound = lastDate;
if (isGlobalSearch) {
_lastSearchPeer = peer;
_lastSearchDate = lastDateFound;
}
} else {
LOG(("API Error: a search results with not loaded peer %1").arg(peerId));
}
if (isMigratedSearch) {
_lastSearchMigratedId = msgId;
} else {
_lastSearchId = msgId;
if (isGlobalSearch) {
_lastSearchPeer = peer;
}
} else {
LOG(("API Error: a search results with not message id"));
LOG(("API Error: a search results with not loaded peer %1").arg(peerId));
}
if (isMigratedSearch) {
_lastSearchMigratedId = msgId;
} else {
_lastSearchId = msgId;
}
}
if (isMigratedSearch) {