From ccd96d92f21955d93f4eb417a5f1eac49153d1af Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 27 Oct 2018 03:15:55 +0300 Subject: [PATCH] Fix option name. GitOrigin-RevId: e7203a982032d7c9f2e53605e8a14a90b0f61d9f --- td/telegram/MessagesManager.cpp | 18 +++++++++--------- td/telegram/MessagesManager.h | 4 ++-- td/telegram/Td.cpp | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 5e4d176f5..e4d468f13 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -5094,12 +5094,12 @@ void MessagesManager::on_update_channel_max_unavailable_message_id(ChannelId cha "on_update_channel_max_unavailable_message_id"); } -void MessagesManager::on_update_include_sponsored_dialog_from_unread_count(bool include_sponsored_dialog) { +void MessagesManager::on_update_include_sponsored_dialog_to_unread_count(bool include_sponsored_dialog) { if (td_->auth_manager_->is_bot()) { // just in case return; } - if (include_sponsored_dialog_from_unread_count_ == include_sponsored_dialog) { + if (include_sponsored_dialog_to_unread_count_ == include_sponsored_dialog) { return; } if (sponsored_dialog_id_.is_valid()) { @@ -5107,7 +5107,7 @@ void MessagesManager::on_update_include_sponsored_dialog_from_unread_count(bool get_dialog_force(sponsored_dialog_id_); } - include_sponsored_dialog_from_unread_count_ = include_sponsored_dialog; + include_sponsored_dialog_to_unread_count_ = include_sponsored_dialog; if (!sponsored_dialog_id_.is_valid()) { // nothing has changed @@ -5122,10 +5122,10 @@ void MessagesManager::on_update_include_sponsored_dialog_from_unread_count(bool CHECK(d != nullptr); auto unread_count = d->server_unread_count + d->local_unread_count; if (unread_count != 0 && is_message_unread_count_inited_) { - send_update_unread_message_count(d->dialog_id, true, "on_update_include_sponsored_dialog_from_unread_count"); + send_update_unread_message_count(d->dialog_id, true, "on_update_include_sponsored_dialog_to_unread_count"); } if ((unread_count != 0 || d->is_marked_as_unread) && is_dialog_unread_count_inited_) { - send_update_unread_chat_count(d->dialog_id, true, "on_update_include_sponsored_dialog_from_unread_count"); + send_update_unread_chat_count(d->dialog_id, true, "on_update_include_sponsored_dialog_to_unread_count"); } } @@ -8523,8 +8523,8 @@ void MessagesManager::tear_down() { void MessagesManager::start_up() { always_wait_for_mailbox(); - include_sponsored_dialog_from_unread_count_ = - G()->shared_config().get_option_boolean("include_sponsored_chat_from_unread_count"); + include_sponsored_dialog_to_unread_count_ = + G()->shared_config().get_option_boolean("include_sponsored_chat_to_unread_count"); if (G()->parameters().use_message_db) { auto last_database_server_dialog_date_string = G()->td_db()->get_binlog_pmc()->get("last_server_dialog_date"); @@ -23195,7 +23195,7 @@ td_api::object_ptr MessagesManager::get_update int32 unread_count = unread_message_total_count_; int32 unread_unmuted_count = unread_message_total_count_ - unread_message_muted_count_; - if (!include_sponsored_dialog_from_unread_count_ && sponsored_dialog_id_.is_valid()) { + if (!include_sponsored_dialog_to_unread_count_ && sponsored_dialog_id_.is_valid()) { const Dialog *d = get_dialog(sponsored_dialog_id_); CHECK(d != nullptr); auto sponsored_unread_count = d->server_unread_count + d->local_unread_count; @@ -23229,7 +23229,7 @@ td_api::object_ptr MessagesManager::get_update_un CHECK(unread_marked_count >= 0); CHECK(unread_unmuted_marked_count >= 0); - if (!include_sponsored_dialog_from_unread_count_ && sponsored_dialog_id_.is_valid()) { + if (!include_sponsored_dialog_to_unread_count_ && sponsored_dialog_id_.is_valid()) { const Dialog *d = get_dialog(sponsored_dialog_id_); CHECK(d != nullptr); auto sponsored_unread_count = d->server_unread_count + d->local_unread_count; diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 562e6d413..68c27178e 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -285,7 +285,7 @@ class MessagesManager : public Actor { void on_update_channel_max_unavailable_message_id(ChannelId channel_id, MessageId max_unavailable_message_id); - void on_update_include_sponsored_dialog_from_unread_count(bool include_sponsored_dialog); + void on_update_include_sponsored_dialog_to_unread_count(bool include_sponsored_dialog); void on_user_dialog_action(DialogId dialog_id, UserId user_id, tl_object_ptr &&action, MessageContentType message_content_type = MessageContentType::None); @@ -2056,7 +2056,7 @@ class MessagesManager : public Actor { ScopeNotificationSettings users_notification_settings_; ScopeNotificationSettings chats_notification_settings_; - bool include_sponsored_dialog_from_unread_count_ = false; + bool include_sponsored_dialog_to_unread_count_ = false; bool have_postponed_unread_message_count_update_ = false; bool have_postponed_unread_chat_count_update_ = false; bool is_message_unread_count_inited_ = false; diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 5e06cda8b..69da0c159 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -3446,8 +3446,8 @@ void Td::on_config_option_updated(const string &name) { return stickers_manager_->on_update_recent_stickers_limit(G()->shared_config().get_option_integer(name)); } else if (name == "favorite_stickers_limit") { stickers_manager_->on_update_favorite_stickers_limit(G()->shared_config().get_option_integer(name)); - } else if (name == "include_sponsored_chat_from_unread_count") { - messages_manager_->on_update_include_sponsored_dialog_from_unread_count( + } else if (name == "include_sponsored_chat_to_unread_count") { + messages_manager_->on_update_include_sponsored_dialog_to_unread_count( G()->shared_config().get_option_boolean(name)); } else if (name == "my_id") { G()->set_my_id(G()->shared_config().get_option_integer(name)); @@ -6184,7 +6184,7 @@ void Td::on_request(uint64 id, td_api::setOption &request) { } // this option currently can't be set, because unread count doesn't work for channels, // in which user have never been a member - if (false && !is_bot && set_boolean_option("include_sponsored_chat_from_unread_count")) { + if (false && !is_bot && set_boolean_option("include_sponsored_chat_to_unread_count")) { return; } break;