2023-07-14 13:54:35 +02:00
|
|
|
//
|
2024-01-01 01:07:21 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
2023-07-14 13:54:35 +02:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "td/telegram/td_api.h"
|
|
|
|
#include "td/telegram/telegram_api.h"
|
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
|
|
|
#include "td/utils/Promise.h"
|
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
class Td;
|
|
|
|
|
|
|
|
class GlobalPrivacySettings {
|
2024-01-19 12:25:24 +01:00
|
|
|
enum class SetType : int32 { None, Archive, ReadDate, NewChat };
|
2024-01-09 13:54:25 +01:00
|
|
|
SetType set_type_ = SetType::None;
|
2023-07-14 13:54:35 +02:00
|
|
|
bool archive_and_mute_new_noncontact_peers_ = false;
|
|
|
|
bool keep_archived_unmuted_ = false;
|
|
|
|
bool keep_archived_folders_ = false;
|
2024-01-09 14:00:59 +01:00
|
|
|
bool hide_read_marks_ = false;
|
|
|
|
bool new_noncontact_peers_require_premium_ = false;
|
2023-07-14 13:54:35 +02:00
|
|
|
|
2024-01-09 13:54:25 +01:00
|
|
|
void apply_changes(const GlobalPrivacySettings &set_settings);
|
|
|
|
|
2023-07-14 13:54:35 +02:00
|
|
|
public:
|
|
|
|
explicit GlobalPrivacySettings(telegram_api::object_ptr<telegram_api::globalPrivacySettings> &&settings);
|
|
|
|
|
2023-07-14 14:25:32 +02:00
|
|
|
explicit GlobalPrivacySettings(td_api::object_ptr<td_api::archiveChatListSettings> &&settings);
|
|
|
|
|
2024-01-09 15:56:47 +01:00
|
|
|
explicit GlobalPrivacySettings(td_api::object_ptr<td_api::readDatePrivacySettings> &&settings);
|
|
|
|
|
2024-01-19 12:25:24 +01:00
|
|
|
explicit GlobalPrivacySettings(td_api::object_ptr<td_api::newChatPrivacySettings> &&settings);
|
|
|
|
|
2023-07-14 14:25:32 +02:00
|
|
|
telegram_api::object_ptr<telegram_api::globalPrivacySettings> get_input_global_privacy_settings() const;
|
|
|
|
|
2023-07-14 13:54:35 +02:00
|
|
|
td_api::object_ptr<td_api::archiveChatListSettings> get_archive_chat_list_settings_object() const;
|
|
|
|
|
2024-01-09 15:11:22 +01:00
|
|
|
td_api::object_ptr<td_api::readDatePrivacySettings> get_read_date_privacy_settings_object() const;
|
|
|
|
|
2024-01-19 12:25:24 +01:00
|
|
|
td_api::object_ptr<td_api::newChatPrivacySettings> get_new_chat_privacy_settings_object() const;
|
|
|
|
|
2024-01-09 13:14:45 +01:00
|
|
|
static void get_global_privacy_settings(Td *td, Promise<GlobalPrivacySettings> &&promise);
|
2023-07-14 14:25:32 +02:00
|
|
|
|
|
|
|
static void set_global_privacy_settings(Td *td, GlobalPrivacySettings settings, Promise<Unit> &&promise);
|
2023-07-14 13:54:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace td
|