mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Refactored counting idle time.
- psIdleTime() was replaced with Platform::LastUserInputTime(). - _lastTimeVideoPlayedAt was moved to Application as _lastNonIdleTime. - Call of updateNonIdle() was added while voice is recording. - Fixed #5695. - Thanks Preston. =)
This commit is contained in:
@@ -3767,7 +3767,7 @@ void MainWidget::updateOnline(bool gotOtherOffline) {
|
||||
bool isOnline = !App::quitting() && App::wnd()->isActive();
|
||||
int updateIn = Global::OnlineUpdatePeriod();
|
||||
if (isOnline) {
|
||||
auto idle = psIdleTime();
|
||||
const auto idle = crl::now() - Platform::LastUserInputTime();
|
||||
if (idle >= Global::OfflineIdleTimeout()) {
|
||||
isOnline = false;
|
||||
if (!_isIdle) {
|
||||
@@ -3883,7 +3883,7 @@ void MainWidget::writeDrafts(History *history) {
|
||||
}
|
||||
|
||||
void MainWidget::checkIdleFinish() {
|
||||
if (psIdleTime() < Global::OfflineIdleTimeout()) {
|
||||
if (crl::now() - Platform::LastUserInputTime() < Global::OfflineIdleTimeout()) {
|
||||
_idleFinishTimer.cancel();
|
||||
_isIdle = false;
|
||||
updateOnline();
|
||||
|
Reference in New Issue
Block a user