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

Move _authSession to Main::Account.

This commit is contained in:
John Preston
2019-06-06 12:37:12 +03:00
parent 94c4ea6174
commit 263bbf1788
15 changed files with 85 additions and 99 deletions

View File

@@ -786,8 +786,7 @@ void Application::authSessionCreate(const MTPUser &user) {
return true;
}));
_authSession = std::make_unique<AuthSession>(&activeAccount(), user);
authSessionChanged().notify(true);
activeAccount().createSession(user);
}
void Application::authSessionDestroy() {
@@ -798,12 +797,7 @@ void Application::authSessionDestroy() {
unlockTerms();
_mtproto->clearGlobalHandlers();
// Must be called before Auth().data() is destroyed,
// because streaming media holds pointers to it.
Media::Player::instance()->handleLogout();
_authSession = nullptr;
authSessionChanged().notify(true);
activeAccount().destroySession();
Notify::unreadCounterUpdated();
}