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

os x setup done, fixing localtime on each os x wakeup or application active status change

This commit is contained in:
John Preston
2014-11-12 23:30:26 +03:00
parent e0ef1d434d
commit 379c5f75e7
33 changed files with 236 additions and 86 deletions

View File

@@ -187,7 +187,7 @@ namespace {
if (!requestId) return false;
int32 secs = m.captured(1).toInt();
uint64 sendAt = getms() + secs * 1000 + 10;
uint64 sendAt = getms(true) + secs * 1000 + 10;
DelayedRequestsList::iterator i = delayedRequests.begin(), e = delayedRequests.end();
for (; i != e; ++i) {
if (i->first == requestId) return true;
@@ -521,8 +521,12 @@ namespace _mtp_internal {
return true;
}
RequestResender::RequestResender() {
connect(&_timer, SIGNAL(timeout()), this, SLOT(checkDelayed()));
}
void RequestResender::checkDelayed() {
uint64 now = getms();
uint64 now = getms(true);
while (!delayedRequests.isEmpty() && now >= delayedRequests.front().second) {
mtpRequestId requestId = delayedRequests.front().first;
delayedRequests.pop_front();
@@ -553,7 +557,7 @@ namespace _mtp_internal {
}
if (!delayedRequests.isEmpty()) {
QTimer::singleShot(delayedRequests.front().second - now, this, SLOT(checkDelayed()));
_timer.start(delayedRequests.front().second - now);
}
}
};