/* 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 #include "mtproto/sender.h" namespace Core { struct CloudPasswordState; } // namespace Core class ApiWrap; namespace Main { class Session; } // namespace Main namespace Api { class CloudPassword final { public: explicit CloudPassword(not_null api); void reload(); void applyPendingReset(const MTPaccount_ResetPasswordResult &data); void clearUnconfirmedPassword(); rpl::producer state() const; std::optional stateCurrent() const; private: MTP::Sender _api; mtpRequestId _requestId = 0; std::unique_ptr _state; rpl::event_stream _stateChanges; }; } // namespace Api