Add td_api::premiumLimitTypePinnedSavedMessagesTopicsCount.

This commit is contained in:
levlam 2024-01-18 18:34:39 +03:00
parent 30dad21fae
commit 643b896958
5 changed files with 22 additions and 8 deletions

View File

@ -4636,6 +4636,9 @@ premiumLimitTypeChatFolderChosenChatCount = PremiumLimitType;
//@description The maximum number of pinned chats in the archive chat list
premiumLimitTypePinnedArchivedChatCount = PremiumLimitType;
//@description The maximum number of pinned Saved Messages topics
premiumLimitTypePinnedSavedMessagesTopicCount = PremiumLimitType;
//@description The maximum length of sent media caption
premiumLimitTypeCaptionLength = PremiumLimitType;

View File

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

View File

@ -13458,12 +13458,12 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
if (dialog_id == my_dialog_id) {
if (!message->saved_messages_topic_id.is_valid()) {
LOG(ERROR) << "Receive no saved messages topic for " << message_id << " in " << dialog_id;
LOG(ERROR) << "Receive no Saved Messages topic for " << message_id << " in " << dialog_id;
message->saved_messages_topic_id = SavedMessagesTopicId(my_dialog_id, message->forward_info.get());
}
} else {
if (message->saved_messages_topic_id.is_valid()) {
LOG(ERROR) << "Receive saved messages topic " << message_info.saved_messages_topic_id << " for " << message_id
LOG(ERROR) << "Receive Saved Messages topic " << message_info.saved_messages_topic_id << " for " << message_id
<< " in " << dialog_id;
message->saved_messages_topic_id = SavedMessagesTopicId();
}
@ -33696,7 +33696,7 @@ bool MessagesManager::update_message(Dialog *d, Message *old_message, unique_ptr
old_message->had_forward_info = new_message->had_forward_info;
}
if (old_message->saved_messages_topic_id != new_message->saved_messages_topic_id) {
LOG(ERROR) << "Saved messages topic for " << message_id << " in " << dialog_id << " changed from "
LOG(ERROR) << "Saved Messages topic for " << message_id << " in " << dialog_id << " changed from "
<< old_message->saved_messages_topic_id << " to " << new_message->saved_messages_topic_id;
old_message->saved_messages_topic_id = new_message->saved_messages_topic_id;
need_send_update = true;

View File

@ -155,9 +155,11 @@ void OptionManager::update_premium_options() {
set_option_integer("chat_folder_count_max", get_option_integer("dialog_filters_limit_premium", 20));
set_option_integer("chat_folder_chosen_chat_count_max",
get_option_integer("dialog_filters_chats_limit_premium", 200));
set_option_integer("pinned_chat_count_max", get_option_integer("dialogs_pinned_limit_premium", 200));
set_option_integer("pinned_chat_count_max", get_option_integer("dialogs_pinned_limit_premium", 100));
set_option_integer("pinned_archived_chat_count_max",
get_option_integer("dialogs_folder_pinned_limit_premium", 200));
set_option_integer("pinned_saved_messages_topic_count_max",
get_option_integer("saved_dialogs_pinned_limit_premium", 100));
set_option_integer("bio_length_max", get_option_integer("about_length_limit_premium", 140));
set_option_integer("chat_folder_invite_link_count_max", get_option_integer("chatlist_invites_limit_premium", 20));
set_option_integer("added_shareable_chat_folder_count_max",
@ -174,9 +176,11 @@ void OptionManager::update_premium_options() {
set_option_integer("chat_folder_count_max", get_option_integer("dialog_filters_limit_default", 10));
set_option_integer("chat_folder_chosen_chat_count_max",
get_option_integer("dialog_filters_chats_limit_default", 100));
set_option_integer("pinned_chat_count_max", get_option_integer("dialogs_pinned_limit_default", 100));
set_option_integer("pinned_chat_count_max", get_option_integer("dialogs_pinned_limit_default", 5));
set_option_integer("pinned_archived_chat_count_max",
get_option_integer("dialogs_folder_pinned_limit_default", 100));
set_option_integer("pinned_saved_messages_topic_count_max",
get_option_integer("saved_dialogs_pinned_limit_default", 5));
set_option_integer("bio_length_max", get_option_integer("about_length_limit_default", 70));
set_option_integer("chat_folder_invite_link_count_max", get_option_integer("chatlist_invites_limit_default", 3));
set_option_integer("added_shareable_chat_folder_count_max",
@ -363,7 +367,8 @@ bool OptionManager::is_internal_option(Slice name) {
name == "restriction_add_platforms" || name == "revoke_pm_inbox" || name == "revoke_time_limit" ||
name == "revoke_pm_time_limit";
case 's':
return name == "saved_animations_limit" || name == "saved_gifs_limit_default" ||
return name == "saved_animations_limit" || name == "saved_dialogs_pinned_limit_default" ||
name == "saved_dialogs_pinned_limit_premium" || name == "saved_gifs_limit_default" ||
name == "saved_gifs_limit_premium" || name == "session_count" || name == "since_last_open" ||
name == "stickers_faved_limit_default" || name == "stickers_faved_limit_premium" ||
name == "stickers_normal_by_emoji_per_premium_num" || name == "stickers_premium_by_emoji_num" ||

View File

@ -643,7 +643,8 @@ const vector<Slice> &get_premium_limit_keys() {
"stories_sent_weekly",
"stories_sent_monthly",
"stories_suggested_reactions",
"recommended_channels"};
"recommended_channels",
"saved_dialogs_pinned"};
return limit_keys;
}
@ -664,6 +665,8 @@ static Slice get_limit_type_key(const td_api::PremiumLimitType *limit_type) {
return Slice("dialogs_pinned");
case td_api::premiumLimitTypePinnedArchivedChatCount::ID:
return Slice("dialogs_folder_pinned");
case td_api::premiumLimitTypePinnedSavedMessagesTopicCount::ID:
return Slice("saved_dialogs_pinned");
case td_api::premiumLimitTypeCreatedPublicChatCount::ID:
return Slice("channels_public");
case td_api::premiumLimitTypeCaptionLength::ID:
@ -834,6 +837,9 @@ static td_api::object_ptr<td_api::premiumLimit> get_premium_limit_object(Slice k
if (key == "dialogs_folder_pinned") {
return td_api::make_object<td_api::premiumLimitTypePinnedArchivedChatCount>();
}
if (key == "saved_dialogs_pinned") {
return td_api::make_object<td_api::premiumLimitTypePinnedSavedMessagesTopicCount>();
}
if (key == "channels_public") {
return td_api::make_object<td_api::premiumLimitTypeCreatedPublicChatCount>();
}