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

@@ -636,7 +636,7 @@ void ApiWrap::historyDialogEntryApplied(not_null<History*> history) {
if (!chat->haveLeft()) {
Local::addSavedPeer(
history->peer,
history->chatsListDate());
ParseDateTime(history->chatsListTimeId()));
}
} else if (const auto channel = history->peer->asChannel()) {
const auto inviter = channel->inviter;
@@ -653,12 +653,11 @@ void ApiWrap::historyDialogEntryApplied(not_null<History*> history) {
return;
}
if (!history->chatsListDate().isNull()
&& history->loadedAtBottom()) {
if (history->chatsListTimeId() != 0 && history->loadedAtBottom()) {
if (const auto channel = history->peer->asChannel()) {
const auto inviter = channel->inviter;
if (inviter != 0
&& history->chatsListDate() <= ParseDateTime(channel->inviteDate)
&& history->chatsListTimeId() <= channel->inviteDate
&& channel->amIn()) {
if (const auto from = App::userLoaded(inviter)) {
history->insertJoinedMessage(true);