Add "pinned_story_count_max" option.

This commit is contained in:
levlam 2024-04-25 23:07:11 +03:00
parent 7aca38cab5
commit 4cbf16a14e
4 changed files with 7 additions and 2 deletions

View File

@ -9068,7 +9068,7 @@ getChatArchivedStories chat_id:int53 from_story_id:int32 limit:int32 = Stories;
//@description Changes list of pinned stories on a chat page; requires can_edit_stories right in the chat
//@chat_id Identifier of the chat that posted the stories
//@story_ids New list of pinned stories. All stories must be posted to chat page
//@story_ids New list of pinned stories. All stories must be posted to the chat page first. There can be up to getOption("pinned_story_count_max") pinned stories on a chat page
setChatPinnedStories chat_id:int53 story_ids:vector<int32> = Ok;
//@description Informs TDLib that a story is opened and is being viewed by the user

View File

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

View File

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

View File

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