mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-11 09:19:35 +00:00
Fix idle time checking in MainWidget.
Regression was introduced in 78d00bcf22. Fixes #5779, fixes #5780.
This commit is contained in:
parent
ed93669693
commit
f9f84fd407
@ -3680,7 +3680,7 @@ void MainWidget::updateOnline(bool gotOtherOffline) {
|
||||
bool isOnline = !App::quitting() && App::wnd()->isActive();
|
||||
int updateIn = Global::OnlineUpdatePeriod();
|
||||
if (isOnline) {
|
||||
const auto idle = crl::now() - Platform::LastUserInputTime();
|
||||
const auto idle = crl::now() - Core::App().lastNonIdleTime();
|
||||
if (idle >= Global::OfflineIdleTimeout()) {
|
||||
isOnline = false;
|
||||
if (!_isIdle) {
|
||||
@ -3796,7 +3796,8 @@ void MainWidget::writeDrafts(History *history) {
|
||||
}
|
||||
|
||||
void MainWidget::checkIdleFinish() {
|
||||
if (crl::now() - Platform::LastUserInputTime() < Global::OfflineIdleTimeout()) {
|
||||
if (crl::now() - Core::App().lastNonIdleTime()
|
||||
< Global::OfflineIdleTimeout()) {
|
||||
_idleFinishTimer.cancel();
|
||||
_isIdle = false;
|
||||
updateOnline();
|
||||
|
Loading…
Reference in New Issue
Block a user