Add "chat_folder_new_chats_update_period" option.

This commit is contained in:
levlam 2023-04-06 14:58:46 +03:00
parent 6cef99b3eb
commit a6b0835b84
2 changed files with 9 additions and 1 deletions

View File

@ -6855,7 +6855,7 @@ checkChatFolderInviteLink invite_link:string = ChatFolderInviteLinkInfo;
//@description Adds a chat folder by an invite link @invite_link Invite link for the chat folder @chat_ids Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet
addChatFolderByInviteLink invite_link:string chat_ids:vector<int53> = Ok;
//@description Returns new chats added to a shareable chat folder by its owner. The method should be called at most once in five minutes for the given chat folder @chat_folder_id Chat folder identifier
//@description Returns new chats added to a shareable chat folder by its owner. The method should be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder @chat_folder_id Chat folder identifier
getChatFolderNewChats chat_folder_id:int32 = Chats;
//@description Adds new chats added to a shareable chat folder by its owner to the user's chat folder @chat_folder_id Chat folder identifier @chat_ids Identifiers of the new chats added to the chat folder. The chats are automatically joined if they aren't joined yet

View File

@ -1551,6 +1551,7 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
vector<string> fragment_prefixes;
bool premium_gift_attach_menu_icon = false;
bool premium_gift_text_field_icon = false;
int32 dialog_filter_update_period = 300;
if (config->get_id() == telegram_api::jsonObject::ID) {
for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) {
Slice key = key_value->key_;
@ -1943,6 +1944,10 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
premium_gift_text_field_icon = get_json_value_bool(std::move(key_value->value_), key);
continue;
}
if (key == "chatlist_update_period") {
dialog_filter_update_period = get_json_value_int(std::move(key_value->value_), key);
continue;
}
new_values.push_back(std::move(key_value));
}
@ -2034,6 +2039,9 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
if (telegram_antispam_group_size_min >= 0) {
options.set_option_integer("aggressive_anti_spam_supergroup_member_count_min", telegram_antispam_group_size_min);
}
if (dialog_filter_update_period > 0) {
options.set_option_integer("chat_folder_new_chats_update_period", dialog_filter_update_period);
}
bool is_premium = options.get_option_boolean("is_premium");
if (is_premium) {