Add "can_edit_fact_check" option.

This commit is contained in:
levlam 2024-05-19 23:33:14 +03:00
parent 4cd02020ee
commit 7739c371e5
2 changed files with 11 additions and 1 deletions

View File

@ -1434,6 +1434,7 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
string premium_manage_subscription_url; string premium_manage_subscription_url;
bool need_premium_for_new_chat_privacy = true; bool need_premium_for_new_chat_privacy = true;
bool channel_revenue_withdrawal_enabled = false; bool channel_revenue_withdrawal_enabled = false;
bool can_edit_fact_check = false;
if (config->get_id() == telegram_api::jsonObject::ID) { if (config->get_id() == telegram_api::jsonObject::ID) {
for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) { for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) {
Slice key = key_value->key_; Slice key = key_value->key_;
@ -1996,6 +1997,10 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
G()->set_option_integer("pinned_story_count_max", get_json_value_int(std::move(key_value->value_), key)); G()->set_option_integer("pinned_story_count_max", get_json_value_int(std::move(key_value->value_), key));
continue; continue;
} }
if (key == "can_edit_factcheck") {
can_edit_fact_check = get_json_value_bool(std::move(key_value->value_), key);
continue;
}
new_values.push_back(std::move(key_value)); new_values.push_back(std::move(key_value));
} }
@ -2142,6 +2147,11 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
} else { } else {
options.set_option_empty("stories_changelog_user_id"); options.set_option_empty("stories_changelog_user_id");
} }
if (can_edit_fact_check) {
options.set_option_boolean("can_edit_fact_check", can_edit_fact_check);
} else {
options.set_option_empty("can_edit_fact_check");
}
if (story_viewers_expire_period >= 0) { if (story_viewers_expire_period >= 0) {
options.set_option_integer("story_viewers_expiration_delay", story_viewers_expire_period); options.set_option_integer("story_viewers_expiration_delay", story_viewers_expire_period);

View File

@ -85,7 +85,7 @@ class ConfigManager final : public NetQueryCallback {
private: private:
struct AppConfig { struct AppConfig {
static constexpr int32 CURRENT_VERSION = 44; static constexpr int32 CURRENT_VERSION = 45;
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_;