tdesktop/Telegram/SourceFiles/data/business/data_business_info.h

59 lines
1.5 KiB
C
Raw Normal View History

2024-02-21 18:25:52 +00:00
/*
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<Session*> owner);
~BusinessInfo();
void preload();
2024-03-01 13:28:51 +00:00
void saveWorkingHours(WorkingHours data, Fn<void(QString)> fail);
2024-02-21 18:25:52 +00:00
2024-03-01 13:28:51 +00:00
void saveAwaySettings(AwaySettings data, Fn<void(QString)> fail);
void applyAwaySettings(AwaySettings data);
[[nodiscard]] AwaySettings awaySettings() const;
[[nodiscard]] bool awaySettingsLoaded() const;
[[nodiscard]] rpl::producer<> awaySettingsChanged() const;
2024-03-01 13:28:51 +00:00
void saveGreetingSettings(
GreetingSettings data,
Fn<void(QString)> fail);
void applyGreetingSettings(GreetingSettings data);
[[nodiscard]] GreetingSettings greetingSettings() const;
[[nodiscard]] bool greetingSettingsLoaded() const;
[[nodiscard]] rpl::producer<> greetingSettingsChanged() const;
2024-02-21 18:25:52 +00:00
void preloadTimezones();
[[nodiscard]] rpl::producer<Timezones> timezonesValue() const;
private:
const not_null<Session*> _owner;
rpl::variable<Timezones> _timezones;
std::optional<AwaySettings> _awaySettings;
rpl::event_stream<> _awaySettingsChanged;
2024-02-21 18:25:52 +00:00
std::optional<GreetingSettings> _greetingSettings;
rpl::event_stream<> _greetingSettingsChanged;
2024-02-21 18:25:52 +00:00
mtpRequestId _timezonesRequestId = 0;
int32 _timezonesHash = 0;
};
} // namespace Data