Improve class names.
This commit is contained in:
parent
255d887bce
commit
498f507646
@ -4816,23 +4816,23 @@ autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max
|
||||
autoDownloadSettingsPresets low:autoDownloadSettings medium:autoDownloadSettings high:autoDownloadSettings = AutoDownloadSettingsPresets;
|
||||
|
||||
|
||||
//@description Contains autosave settings for a chat or a chat scope
|
||||
//@description Contains autosave settings for an autosave settings scope
|
||||
//@autosave_photos True, if photo autosave is enabled
|
||||
//@autosave_videos True, if video autosave is enabled
|
||||
//@max_video_file_size The maximum size of a video file to be autosaved, in bytes; 0 if not limited
|
||||
chatAutosaveSettings autosave_photos:Bool autosave_videos:Bool max_video_file_size:int53 = ChatAutosaveSettings;
|
||||
scopeAutosaveSettings autosave_photos:Bool autosave_videos:Bool max_video_file_size:int53 = ScopeAutosaveSettings;
|
||||
|
||||
//@description Contains autosave settings for a chat, which overrides settings for the corresponding scope
|
||||
//@description Contains autosave settings for a chat, which overrides default settings for the corresponding scope
|
||||
//@chat_id Chat identifier
|
||||
//@settings Autosave settings for the chat
|
||||
chatAutosaveException chat_id:int53 settings:chatAutosaveSettings = ChatAutosaveException;
|
||||
autosaveSettingsException chat_id:int53 settings:scopeAutosaveSettings = AutosaveSettingsException;
|
||||
|
||||
//@description Describes autosave settings
|
||||
//@private_chat_settings Default autosave settings for private chats
|
||||
//@group_settings Default autosave settings for basic group and supergroup chats
|
||||
//@channel_settings Default autosave settings for channel chats
|
||||
//@exceptions Autosave exceptions for specific chats
|
||||
autosaveSettings private_chat_settings:chatAutosaveSettings group_settings:chatAutosaveSettings channel_settings:chatAutosaveSettings exceptions:vector<chatAutosaveException> = AutosaveSettings;
|
||||
//@exceptions Autosave settings for specific chats
|
||||
autosaveSettings private_chat_settings:scopeAutosaveSettings group_settings:scopeAutosaveSettings channel_settings:scopeAutosaveSettings exceptions:vector<autosaveSettingsException> = AutosaveSettings;
|
||||
|
||||
|
||||
//@class ConnectionState @description Describes the current state of the connection to Telegram servers
|
||||
|
@ -83,24 +83,24 @@ AutosaveManager::DialogAutosaveSettings::DialogAutosaveSettings(const telegram_a
|
||||
max_video_file_size_ = settings->video_max_size_;
|
||||
}
|
||||
|
||||
td_api::object_ptr<td_api::chatAutosaveSettings>
|
||||
AutosaveManager::DialogAutosaveSettings::get_chat_autosave_settings_object() const {
|
||||
return td_api::make_object<td_api::chatAutosaveSettings>(autosave_photos_, autosave_videos_, max_video_file_size_);
|
||||
td_api::object_ptr<td_api::scopeAutosaveSettings>
|
||||
AutosaveManager::DialogAutosaveSettings::get_scope_autosave_settings_object() const {
|
||||
return td_api::make_object<td_api::scopeAutosaveSettings>(autosave_photos_, autosave_videos_, max_video_file_size_);
|
||||
}
|
||||
|
||||
td_api::object_ptr<td_api::chatAutosaveException>
|
||||
AutosaveManager::DialogAutosaveSettings::get_chat_autosave_exception_object(DialogId dialog_id) const {
|
||||
return td_api::make_object<td_api::chatAutosaveException>(dialog_id.get(), get_chat_autosave_settings_object());
|
||||
td_api::object_ptr<td_api::autosaveSettingsException>
|
||||
AutosaveManager::DialogAutosaveSettings::get_autosave_settings_exception_object(DialogId dialog_id) const {
|
||||
return td_api::make_object<td_api::autosaveSettingsException>(dialog_id.get(), get_scope_autosave_settings_object());
|
||||
}
|
||||
|
||||
td_api::object_ptr<td_api::autosaveSettings> AutosaveManager::AutosaveSettings::get_autosave_settings_object() const {
|
||||
CHECK(are_inited_);
|
||||
auto exceptions = transform(exceptions_, [](const auto &exception) {
|
||||
return exception.second.get_chat_autosave_exception_object(exception.first);
|
||||
return exception.second.get_autosave_settings_exception_object(exception.first);
|
||||
});
|
||||
return td_api::make_object<td_api::autosaveSettings>(
|
||||
user_settings_.get_chat_autosave_settings_object(), user_settings_.get_chat_autosave_settings_object(),
|
||||
user_settings_.get_chat_autosave_settings_object(), std::move(exceptions));
|
||||
user_settings_.get_scope_autosave_settings_object(), user_settings_.get_scope_autosave_settings_object(),
|
||||
user_settings_.get_scope_autosave_settings_object(), std::move(exceptions));
|
||||
}
|
||||
|
||||
void AutosaveManager::get_autosave_settings(Promise<td_api::object_ptr<td_api::autosaveSettings>> &&promise) {
|
||||
|
@ -41,9 +41,10 @@ class AutosaveManager final : public Actor {
|
||||
|
||||
explicit DialogAutosaveSettings(const telegram_api::autoSaveSettings *settings);
|
||||
|
||||
td_api::object_ptr<td_api::chatAutosaveSettings> get_chat_autosave_settings_object() const;
|
||||
td_api::object_ptr<td_api::scopeAutosaveSettings> get_scope_autosave_settings_object() const;
|
||||
|
||||
td_api::object_ptr<td_api::chatAutosaveException> get_chat_autosave_exception_object(DialogId dialog_id) const;
|
||||
td_api::object_ptr<td_api::autosaveSettingsException> get_autosave_settings_exception_object(
|
||||
DialogId dialog_id) const;
|
||||
};
|
||||
|
||||
struct AutosaveSettings {
|
||||
|
Loading…
x
Reference in New Issue
Block a user