2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05: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

@@ -309,13 +309,13 @@ void Controller::showJumpToDate(not_null<PeerData*> peer, QDate requestedDate) {
auto currentPeerDate = [peer] {
if (auto history = App::historyLoaded(peer)) {
if (history->scrollTopItem) {
return history->scrollTopItem->data()->date.date();
return history->scrollTopItem->dateTime().date();
} else if (history->loadedAtTop() && !history->isEmpty() && history->peer->migrateFrom()) {
if (auto migrated = App::historyLoaded(history->peer->migrateFrom())) {
if (migrated->scrollTopItem) {
// We're up in the migrated history.
// So current date is the date of first message here.
return history->blocks.front()->messages.front()->data()->date.date();
return history->blocks.front()->messages.front()->dateTime().date();
}
}
} else if (!history->chatsListDate().isNull()) {
@@ -344,7 +344,7 @@ void Controller::showJumpToDate(not_null<PeerData*> peer, QDate requestedDate) {
if (auto history = App::historyLoaded(chat)) {
if (history->loadedAtTop()) {
if (!history->isEmpty()) {
return history->blocks.front()->messages.front()->data()->date.date();
return history->blocks.front()->messages.front()->dateTime().date();
}
} else {
return startDate();
@@ -354,7 +354,7 @@ void Controller::showJumpToDate(not_null<PeerData*> peer, QDate requestedDate) {
if (auto history = App::historyLoaded(peer)) {
if (history->loadedAtTop()) {
if (!history->isEmpty()) {
return history->blocks.front()->messages.front()->data()->date.date();
return history->blocks.front()->messages.front()->dateTime().date();
}
return QDate::currentDate();
}