2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use server time in dialogs list sorting.

This way it won't mess up when you change your local time.
This commit is contained in:
John Preston
2018-07-31 17:34:14 +03:00
parent f68cefbdc1
commit 9972f7b90e
10 changed files with 47 additions and 42 deletions

View File

@@ -334,14 +334,14 @@ void Controller::showJumpToDate(Dialogs::Key chat, QDate requestedDate) {
return history->blocks.front()->messages.front()->dateTime().date();
}
}
} else if (!history->chatsListDate().isNull()) {
return history->chatsListDate().date();
} else if (history->chatsListTimeId() != 0) {
return ParseDateTime(history->chatsListTimeId()).date();
}
} else if (const auto feed = chat.feed()) {
/*if (chatScrollPosition(feed)) { // #TODO feeds save position
} else */if (!feed->chatsListDate().isNull()) {
return feed->chatsListDate().date();
} else */if (feed->chatsListTimeId() != 0) {
return ParseDateTime(feed->chatsListTimeId()).date();
}
}
return QDate::currentDate();
@@ -351,12 +351,12 @@ void Controller::showJumpToDate(Dialogs::Key chat, QDate requestedDate) {
if (const auto channel = history->peer->migrateTo()) {
history = App::historyLoaded(channel);
}
if (history && !history->chatsListDate().isNull()) {
return history->chatsListDate().date();
if (history && history->chatsListTimeId() != 0) {
return ParseDateTime(history->chatsListTimeId()).date();
}
} else if (const auto feed = chat.feed()) {
if (!feed->chatsListDate().isNull()) {
return feed->chatsListDate().date();
if (feed->chatsListTimeId() != 0) {
return ParseDateTime(feed->chatsListTimeId()).date();
}
}
return QDate::currentDate();