diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index 030d29d45..321e4bcee 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -2018,6 +2018,22 @@ void ConfigManager::process_app_config(tl_object_ptr &c clamp(get_json_value_int(std::move(key_value->value_), key), 0, 1000000)); continue; } + if (key == "web_app_allowed_protocols") { + if (value->get_id() == telegram_api::jsonArray::ID) { + vector protocol_names; + auto protocols = std::move(static_cast(value)->value_); + for (auto &protocol : protocols) { + auto protocol_name = get_json_value_string(std::move(protocol), key); + if (!td::contains(protocol_name, ' ')) { + protocol_names.push_back(std::move(protocol_name)); + } + } + G()->set_option_string("web_app_allowed_protocols", implode(protocol_names, ' ')); + } else { + LOG(ERROR) << "Receive unexpected web_app_allowed_protocols " << to_string(*value); + } + continue; + } new_values.push_back(std::move(key_value)); } diff --git a/td/telegram/ConfigManager.h b/td/telegram/ConfigManager.h index 86674904a..7281ba0a3 100644 --- a/td/telegram/ConfigManager.h +++ b/td/telegram/ConfigManager.h @@ -85,7 +85,7 @@ class ConfigManager final : public NetQueryCallback { private: struct AppConfig { - static constexpr int32 CURRENT_VERSION = 49; + static constexpr int32 CURRENT_VERSION = 50; int32 version_ = 0; int32 hash_ = 0; telegram_api::object_ptr config_;