diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index ea3511aa9..c9306cfdf 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2449,7 +2449,8 @@ void MainWidget::updateOnline(bool gotOtherOffline) { int updateIn = cOnlineUpdatePeriod(); if (isOnline) { uint64 idle = psIdleTime(); - if (idle >= cOfflineIdleTimeout()) { + LOG(("Idle: %1").arg(idle)); + if (idle >= uint64(cOfflineIdleTimeout())) { isOnline = false; if (!_isIdle) { _isIdle = true; @@ -2476,13 +2477,14 @@ void MainWidget::updateOnline(bool gotOtherOffline) { updateOnlineDisplay(); } else if (isOnline) { - updateIn = _lastSetOnline + cOnlineUpdatePeriod() - ms; + updateIn = qMin(updateIn, int(_lastSetOnline + cOnlineUpdatePeriod() - ms)); } + LOG(("UPDATE IN: %1").arg(updateIn)); _onlineTimer.start(updateIn); } void MainWidget::checkIdleFinish() { - if (psIdleTime() < cOfflineIdleTimeout()) { + if (psIdleTime() < uint64(cOfflineIdleTimeout())) { _idleFinishTimer.stop(); _isIdle = false; updateOnline(); diff --git a/Telegram/SourceFiles/pspecific_mac.h b/Telegram/SourceFiles/pspecific_mac.h index 0e04cb8fd..1fb495f9c 100644 --- a/Telegram/SourceFiles/pspecific_mac.h +++ b/Telegram/SourceFiles/pspecific_mac.h @@ -89,7 +89,6 @@ public slots: void psUpdateDelegate(); void psSavePosition(Qt::WindowState state = Qt::WindowActive); - void psIdleTimeout(); void psShowTrayMenu(); void psMacUndo();