2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Move autolock checking to Core::Application.

This commit is contained in:
John Preston
2020-06-08 19:56:52 +04:00
parent 4b354b0928
commit 27af83267e
9 changed files with 63 additions and 62 deletions

View File

@@ -3061,7 +3061,7 @@ void MainWidget::feedDifference(
const MTPVector<MTPChat> &chats,
const MTPVector<MTPMessage> &msgs,
const MTPVector<MTPUpdate> &other) {
session().checkAutoLock();
Core::App().checkAutoLock();
session().data().processUsers(users);
session().data().processChats(chats);
feedMessageIds(other);
@@ -3523,8 +3523,7 @@ MainWidget::~MainWidget() {
}
void MainWidget::updateOnline(bool gotOtherOffline) {
if (this != App::main()) return;
InvokeQueued(this, [=] { session().checkAutoLock(); });
crl::on_main(this, [] { Core::App().checkAutoLock(); });
bool isOnline = !App::quitting() && App::wnd()->isActive();
int updateIn = Global::OnlineUpdatePeriod();
@@ -3660,7 +3659,7 @@ void MainWidget::checkIdleFinish() {
}
void MainWidget::mtpNewSessionCreated() {
session().checkAutoLock();
Core::App().checkAutoLock();
updSeq = 0;
MTP_LOG(0, ("getDifference { after new_session_created }%1"
).arg(cTestMode() ? " TESTMODE" : ""));
@@ -3668,7 +3667,7 @@ void MainWidget::mtpNewSessionCreated() {
}
void MainWidget::mtpUpdateReceived(const MTPUpdates &updates) {
session().checkAutoLock();
Core::App().checkAutoLock();
_lastUpdateTime = crl::now();
_noUpdatesTimer.callOnce(kNoUpdatesTimeout);
if (!requestingDifference()