2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Support logout of a secondary account.

This commit is contained in:
John Preston
2020-06-16 13:40:43 +04:00
parent 5e045ec02c
commit bc144377c0
18 changed files with 189 additions and 81 deletions

View File

@@ -170,7 +170,6 @@ void Account::destroySession() {
if (!sessionExists()) {
return;
}
session().data().clear();
_sessionValue = nullptr;
_session = nullptr;
@@ -442,6 +441,10 @@ void Account::logOut() {
}
}
bool Account::loggingOut() const {
return _loggingOut;
}
void Account::forcedLogOut() {
if (sessionExists()) {
resetAuthorizationKeys();
@@ -451,20 +454,10 @@ void Account::forcedLogOut() {
void Account::loggedOut() {
_loggingOut = false;
if (Global::LocalPasscode()) {
Global::SetLocalPasscode(false);
Global::RefLocalPasscodeChanged().notify();
}
Core::App().unlockPasscode();
Core::App().unlockTerms();
Media::Player::mixer()->stopAndClear();
Global::SetVoiceMsgPlaybackDoubled(false);
if (const auto window = Core::App().activeWindow()) {
window->tempDirDelete(Local::ClearManagerAll);
window->setupIntro();
}
if (sessionExists()) {
session().data().clearLocalStorage();
}
destroySession();
local().reset();