/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once class AuthSession; namespace Main { class Account final { public: explicit Account(const QString &dataName); ~Account(); Account(const Account &other) = delete; Account &operator=(const Account &other) = delete; void createSession(const MTPUser &user); void destroySession(); [[nodiscard]] bool sessionExists() const; [[nodiscard]] AuthSession &session(); [[nodiscard]] rpl::producer sessionValue() const; [[nodiscard]] rpl::producer sessionChanges() const; [[nodiscard]] MTP::Instance *mtp(); private: std::unique_ptr _session; rpl::variable _sessionValue; }; } // namespace Main