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

Remove Session::Exists() global access point.

This commit is contained in:
John Preston
2020-06-10 17:24:41 +04:00
parent 5f8d22f1f2
commit 598fb67cdf
19 changed files with 119 additions and 133 deletions

View File

@@ -126,12 +126,10 @@ void Account::createSession(
Expects(_sessionValue.current() == nullptr);
_session = std::make_unique<Session>(this, user, std::move(settings));
if (!serialized.isEmpty()) {
// For now it depends on Auth() which depends on _sessionValue.
local().readSelf(serialized, streamVersion);
local().readSelf(_session.get(), serialized, streamVersion);
}
_sessionValue = _session.get();
}
@@ -154,13 +152,7 @@ bool Account::sessionExists() const {
return (_sessionValue.current() != nullptr);
}
Session &Account::session() {
Expects(sessionExists());
return *_sessionValue.current();
}
const Session &Account::session() const {
Session &Account::session() const {
Expects(sessionExists());
return *_sessionValue.current();