2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Request dialog list entries when needed.

Also save the original server-side int32 date in HistoryItems.
This commit is contained in:
John Preston
2018-02-03 22:52:35 +03:00
parent 0c5efb935d
commit 8bacc74d8b
50 changed files with 719 additions and 549 deletions

View File

@@ -32,22 +32,6 @@ uint64 PinnedDialogPos(int pinnedIndex) {
} // namespace
bool MessageIsLess(not_null<HistoryItem*> a, not_null<HistoryItem*> b) {
if (a->date < b->date) {
return true;
} else if (b->date < a->date) {
return false;
}
const auto apeer = a->history()->peer->bareId();
const auto bpeer = b->history()->peer->bareId();
if (apeer < bpeer) {
return true;
} else if (bpeer < apeer) {
return false;
}
return a->id < b->id;
}
Entry::Entry(const Key &key)
: lastItemTextCache(st::dialogsTextWidthMin)
, _key(key) {
@@ -127,7 +111,7 @@ PositionChange Entry::adjustByPosInChatList(
return { movedFrom, movedTo };
}
void Entry::setChatsListDate(const QDateTime &date) {
void Entry::setChatsListDate(QDateTime date) {
if (!_lastMessageDate.isNull() && _lastMessageDate >= date) {
if (!inChatList(Dialogs::Mode::All)) {
return;