/* 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 "data/business/data_business_common.h" namespace Data { class Session; class BusinessInfo final { public: explicit BusinessInfo(not_null owner); ~BusinessInfo(); void preload(); void saveWorkingHours(WorkingHours data, Fn fail); void saveChatIntro(ChatIntro data, Fn fail); void saveAwaySettings(AwaySettings data, Fn fail); void applyAwaySettings(AwaySettings data); [[nodiscard]] AwaySettings awaySettings() const; [[nodiscard]] bool awaySettingsLoaded() const; [[nodiscard]] rpl::producer<> awaySettingsChanged() const; void saveGreetingSettings( GreetingSettings data, Fn fail); void applyGreetingSettings(GreetingSettings data); [[nodiscard]] GreetingSettings greetingSettings() const; [[nodiscard]] bool greetingSettingsLoaded() const; [[nodiscard]] rpl::producer<> greetingSettingsChanged() const; void preloadTimezones(); [[nodiscard]] bool timezonesLoaded() const; [[nodiscard]] rpl::producer timezonesValue() const; private: const not_null _owner; rpl::variable _timezones; std::optional _awaySettings; rpl::event_stream<> _awaySettingsChanged; std::optional _greetingSettings; rpl::event_stream<> _greetingSettingsChanged; mtpRequestId _timezonesRequestId = 0; int32 _timezonesHash = 0; }; [[nodiscard]] QString FindClosestTimezoneId( const std::vector &list); } // namespace Data