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

Several working accounts together.

This commit is contained in:
John Preston
2020-06-16 10:42:47 +04:00
parent 6fc5e22882
commit ab5796c117
14 changed files with 97 additions and 60 deletions

View File

@@ -64,6 +64,11 @@ void Account::start(std::shared_ptr<MTP::AuthKey> localKey) {
finishStarting();
}
void Account::startAdded(std::shared_ptr<MTP::AuthKey> localKey) {
_local->startAdded(std::move(localKey));
finishStarting();
}
void Account::finishStarting() {
_appConfig = std::make_unique<AppConfig>(this);
watchProxyChanges();
@@ -151,10 +156,11 @@ void Account::createSession(
_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(_session.get(), serialized, streamVersion);
}
_sessionValue = _session.get();
Ensures(_session != nullptr);
}
void Account::destroySession() {