Remove redundant parameters.

This commit is contained in:
levlam 2022-08-17 21:40:03 +03:00
parent f9161dccc3
commit 9fddbf4ee8
5 changed files with 14 additions and 12 deletions

View File

@ -442,7 +442,8 @@ void AnimationsManager::on_update_animation_search_provider(string animation_sea
try_send_update_animation_search_parameters();
}
void AnimationsManager::on_update_saved_animations_limit(int32 saved_animations_limit) {
void AnimationsManager::on_update_saved_animations_limit() {
int32 saved_animations_limit = narrow_cast<int32>(G()->get_option_integer("saved_animations_limit", 200));
if (saved_animations_limit != saved_animations_limit_) {
if (saved_animations_limit > 0) {
LOG(INFO) << "Update saved animations limit to " << saved_animations_limit;

View File

@ -65,7 +65,7 @@ class AnimationsManager final : public Actor {
void on_update_animation_search_provider(string animation_search_provider);
void on_update_saved_animations_limit(int32 saved_animations_limit);
void on_update_saved_animations_limit();
void reload_saved_animations(bool force);

View File

@ -242,7 +242,7 @@ void OptionManager::on_option_updated(const string &name) {
break;
case 'f':
if (name == "favorite_stickers_limit") {
td_->stickers_manager_->on_update_favorite_stickers_limit(narrow_cast<int32>(G()->get_option_integer(name)));
td_->stickers_manager_->on_update_favorite_stickers_limit();
}
break;
case 'i':
@ -310,12 +310,12 @@ void OptionManager::on_option_updated(const string &name) {
send_closure(td_->top_dialog_manager_actor_, &TopDialogManager::update_rating_e_decay);
}
if (name == "recent_stickers_limit") {
td_->stickers_manager_->on_update_recent_stickers_limit(narrow_cast<int32>(G()->get_option_integer(name)));
td_->stickers_manager_->on_update_recent_stickers_limit();
}
break;
case 's':
if (name == "saved_animations_limit") {
td_->animations_manager_->on_update_saved_animations_limit(narrow_cast<int32>(G()->get_option_integer(name)));
td_->animations_manager_->on_update_saved_animations_limit();
}
if (name == "session_count") {
G()->net_query_dispatcher().update_session_count();

View File

@ -1389,9 +1389,8 @@ StickersManager::StickersManager(Td *td, ActorShared<> parent) : td_(td), parent
upload_sticker_file_callback_ = std::make_shared<UploadStickerFileCallback>();
on_update_animated_emoji_zoom();
on_update_recent_stickers_limit(narrow_cast<int32>(G()->get_option_integer("recent_stickers_limit", 200)));
on_update_favorite_stickers_limit(narrow_cast<int32>(G()->get_option_integer("favorite_stickers_limit", 5)));
on_update_recent_stickers_limit();
on_update_favorite_stickers_limit();
next_click_animated_emoji_message_time_ = Time::now();
next_update_animated_emoji_clicked_time_ = Time::now();
@ -7905,7 +7904,8 @@ void StickersManager::on_update_animated_emoji_zoom() {
animated_emoji_zoom_ = static_cast<double>(G()->get_option_integer("animated_emoji_zoom", 625000000)) * 1e-9;
}
void StickersManager::on_update_recent_stickers_limit(int32 recent_stickers_limit) {
void StickersManager::on_update_recent_stickers_limit() {
auto recent_stickers_limit = narrow_cast<int32>(G()->get_option_integer("recent_stickers_limit", 200));
if (recent_stickers_limit != recent_stickers_limit_) {
if (recent_stickers_limit > 0) {
LOG(INFO) << "Update recent stickers limit to " << recent_stickers_limit;
@ -7922,7 +7922,8 @@ void StickersManager::on_update_recent_stickers_limit(int32 recent_stickers_limi
}
}
void StickersManager::on_update_favorite_stickers_limit(int32 favorite_stickers_limit) {
void StickersManager::on_update_favorite_stickers_limit() {
auto favorite_stickers_limit = narrow_cast<int32>(G()->get_option_integer("favorite_stickers_limit", 5));
if (favorite_stickers_limit != favorite_stickers_limit_) {
if (favorite_stickers_limit > 0) {
LOG(INFO) << "Update favorite stickers limit to " << favorite_stickers_limit;

View File

@ -279,9 +279,9 @@ class StickersManager final : public Actor {
void clear_recent_stickers(bool is_attached, Promise<Unit> &&promise);
void on_update_recent_stickers_limit(int32 recent_stickers_limit);
void on_update_recent_stickers_limit();
void on_update_favorite_stickers_limit(int32 favorite_stickers_limit);
void on_update_favorite_stickers_limit();
void reload_favorite_stickers(bool force);