2017-12-04 17:46:03 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-12-04 17:46:03 +00:00
|
|
|
|
2018-01-03 10:23:14 +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();
|
|
|
|
|
2018-04-09 17:48:29 +00:00
|
|
|
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);
|
2018-04-09 17:48:29 +00:00
|
|
|
|
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
|