tdesktop/Telegram/SourceFiles/data/data_notify_settings.h

39 lines
836 B
C
Raw Normal View History

2017-12-04 17:46:03 +00:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2017-12-04 17:46:03 +00:00
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
2017-12-04 17:46:03 +00:00
*/
#pragma once
namespace Data {
class NotifySettingsValue;
class NotifySettings {
public:
NotifySettings();
static constexpr auto kDefaultMutePeriod = 86400 * 365;
2017-12-04 17:46:03 +00:00
bool change(const MTPPeerNotifySettings &settings);
bool change(
2018-09-21 16:28:46 +00:00
std::optional<int> muteForSeconds,
std::optional<bool> silentPosts);
2017-12-04 17:46:03 +00:00
bool settingsUnknown() const;
2018-09-21 16:28:46 +00:00
std::optional<TimeId> muteUntil() const;
std::optional<bool> silentPosts() const;
2017-12-04 17:46:03 +00:00
MTPinputPeerNotifySettings serialize() const;
~NotifySettings();
private:
bool _known = false;
std::unique_ptr<NotifySettingsValue> _value;
};
} // namespace Data