Add "business_chat_link_count_max" option.

This commit is contained in:
levlam 2024-04-11 21:18:57 +03:00
parent 8e35a2477c
commit c0abb6348b
4 changed files with 8 additions and 2 deletions

View File

@ -9772,7 +9772,8 @@ removeBusinessConnectedBotFromChat chat_id:int53 = Ok;
//@description Returns business chat links created for the current account //@description Returns business chat links created for the current account
getBusinessChatLinks = BusinessChatLinks; getBusinessChatLinks = BusinessChatLinks;
//@description Creates a business chat link for the current account. Requires Telegram Business subscription. Returns the created link @link Description of the link to create //@description Creates a business chat link for the current account. Requires Telegram Business subscription. There can be up to getOption("business_chat_link_count_max") links created. Returns the created link
//@link Description of the link to create
createBusinessChatLink link:inputBusinessChatLink = BusinessChatLink; createBusinessChatLink link:inputBusinessChatLink = BusinessChatLink;

View File

@ -2054,6 +2054,10 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
G()->set_option_integer(key, get_json_value_int(std::move(key_value->value_), key)); G()->set_option_integer(key, get_json_value_int(std::move(key_value->value_), key));
continue; continue;
} }
if (key == "business_chat_links_limit") {
G()->set_option_integer("business_chat_link_count_max", get_json_value_int(std::move(key_value->value_), key));
continue;
}
new_values.push_back(std::move(key_value)); new_values.push_back(std::move(key_value));
} }

View File

@ -103,7 +103,7 @@ class ConfigManager final : public NetQueryCallback {
private: private:
struct AppConfig { struct AppConfig {
static constexpr int32 CURRENT_VERSION = 39; static constexpr int32 CURRENT_VERSION = 40;
int32 version_ = 0; int32 version_ = 0;
int32 hash_ = 0; int32 hash_ = 0;
telegram_api::object_ptr<telegram_api::JSONValue> config_; telegram_api::object_ptr<telegram_api::JSONValue> config_;

View File

@ -148,6 +148,7 @@ OptionManager::OptionManager(Td *td)
set_default_integer_option("premium_download_speedup", 10); set_default_integer_option("premium_download_speedup", 10);
set_default_integer_option("premium_upload_speedup", 10); set_default_integer_option("premium_upload_speedup", 10);
set_default_integer_option("upload_premium_speedup_notify_period", 3600); set_default_integer_option("upload_premium_speedup_notify_period", 3600);
set_default_integer_option("business_chat_link_count_max", is_test_dc ? 5 : 100);
if (options.isset("my_phone_number") || !options.isset("my_id")) { if (options.isset("my_phone_number") || !options.isset("my_id")) {
update_premium_options(); update_premium_options();