mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02: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:
@@ -125,6 +125,14 @@ QDateTime ParseDateTime(TimeId serverTime) {
|
||||
return QDateTime::fromTime_t(serverTime - unixtimeDelta);
|
||||
}
|
||||
|
||||
TimeId ServerTimeFromParsed(const QDateTime &date) {
|
||||
if (date.isNull()) {
|
||||
return TimeId(0);
|
||||
}
|
||||
QReadLocker locker(&unixtimeLock);
|
||||
return date.toTime_t() + unixtimeDelta;
|
||||
}
|
||||
|
||||
// Precise timing functions / rand init
|
||||
|
||||
struct CRYPTO_dynlock_value {
|
||||
|
||||
Reference in New Issue
Block a user