Fix option name.
GitOrigin-RevId: e7203a982032d7c9f2e53605e8a14a90b0f61d9f
This commit is contained in:
parent
2fa81be614
commit
ccd96d92f2
@ -5094,12 +5094,12 @@ void MessagesManager::on_update_channel_max_unavailable_message_id(ChannelId cha
|
|||||||
"on_update_channel_max_unavailable_message_id");
|
"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()) {
|
if (td_->auth_manager_->is_bot()) {
|
||||||
// just in case
|
// just in case
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (include_sponsored_dialog_from_unread_count_ == include_sponsored_dialog) {
|
if (include_sponsored_dialog_to_unread_count_ == include_sponsored_dialog) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (sponsored_dialog_id_.is_valid()) {
|
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_);
|
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()) {
|
if (!sponsored_dialog_id_.is_valid()) {
|
||||||
// nothing has changed
|
// nothing has changed
|
||||||
@ -5122,10 +5122,10 @@ void MessagesManager::on_update_include_sponsored_dialog_from_unread_count(bool
|
|||||||
CHECK(d != nullptr);
|
CHECK(d != nullptr);
|
||||||
auto unread_count = d->server_unread_count + d->local_unread_count;
|
auto unread_count = d->server_unread_count + d->local_unread_count;
|
||||||
if (unread_count != 0 && is_message_unread_count_inited_) {
|
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_) {
|
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() {
|
void MessagesManager::start_up() {
|
||||||
always_wait_for_mailbox();
|
always_wait_for_mailbox();
|
||||||
|
|
||||||
include_sponsored_dialog_from_unread_count_ =
|
include_sponsored_dialog_to_unread_count_ =
|
||||||
G()->shared_config().get_option_boolean("include_sponsored_chat_from_unread_count");
|
G()->shared_config().get_option_boolean("include_sponsored_chat_to_unread_count");
|
||||||
|
|
||||||
if (G()->parameters().use_message_db) {
|
if (G()->parameters().use_message_db) {
|
||||||
auto last_database_server_dialog_date_string = G()->td_db()->get_binlog_pmc()->get("last_server_dialog_date");
|
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<td_api::updateUnreadMessageCount> MessagesManager::get_update
|
|||||||
int32 unread_count = unread_message_total_count_;
|
int32 unread_count = unread_message_total_count_;
|
||||||
int32 unread_unmuted_count = unread_message_total_count_ - unread_message_muted_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_);
|
const Dialog *d = get_dialog(sponsored_dialog_id_);
|
||||||
CHECK(d != nullptr);
|
CHECK(d != nullptr);
|
||||||
auto sponsored_unread_count = d->server_unread_count + d->local_unread_count;
|
auto sponsored_unread_count = d->server_unread_count + d->local_unread_count;
|
||||||
@ -23229,7 +23229,7 @@ td_api::object_ptr<td_api::updateUnreadChatCount> MessagesManager::get_update_un
|
|||||||
CHECK(unread_marked_count >= 0);
|
CHECK(unread_marked_count >= 0);
|
||||||
CHECK(unread_unmuted_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_);
|
const Dialog *d = get_dialog(sponsored_dialog_id_);
|
||||||
CHECK(d != nullptr);
|
CHECK(d != nullptr);
|
||||||
auto sponsored_unread_count = d->server_unread_count + d->local_unread_count;
|
auto sponsored_unread_count = d->server_unread_count + d->local_unread_count;
|
||||||
|
@ -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_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<td_api::ChatAction> &&action,
|
void on_user_dialog_action(DialogId dialog_id, UserId user_id, tl_object_ptr<td_api::ChatAction> &&action,
|
||||||
MessageContentType message_content_type = MessageContentType::None);
|
MessageContentType message_content_type = MessageContentType::None);
|
||||||
@ -2056,7 +2056,7 @@ class MessagesManager : public Actor {
|
|||||||
ScopeNotificationSettings users_notification_settings_;
|
ScopeNotificationSettings users_notification_settings_;
|
||||||
ScopeNotificationSettings chats_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_message_count_update_ = false;
|
||||||
bool have_postponed_unread_chat_count_update_ = false;
|
bool have_postponed_unread_chat_count_update_ = false;
|
||||||
bool is_message_unread_count_inited_ = false;
|
bool is_message_unread_count_inited_ = false;
|
||||||
|
@ -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));
|
return stickers_manager_->on_update_recent_stickers_limit(G()->shared_config().get_option_integer(name));
|
||||||
} else if (name == "favorite_stickers_limit") {
|
} else if (name == "favorite_stickers_limit") {
|
||||||
stickers_manager_->on_update_favorite_stickers_limit(G()->shared_config().get_option_integer(name));
|
stickers_manager_->on_update_favorite_stickers_limit(G()->shared_config().get_option_integer(name));
|
||||||
} else if (name == "include_sponsored_chat_from_unread_count") {
|
} else if (name == "include_sponsored_chat_to_unread_count") {
|
||||||
messages_manager_->on_update_include_sponsored_dialog_from_unread_count(
|
messages_manager_->on_update_include_sponsored_dialog_to_unread_count(
|
||||||
G()->shared_config().get_option_boolean(name));
|
G()->shared_config().get_option_boolean(name));
|
||||||
} else if (name == "my_id") {
|
} else if (name == "my_id") {
|
||||||
G()->set_my_id(G()->shared_config().get_option_integer(name));
|
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,
|
// this option currently can't be set, because unread count doesn't work for channels,
|
||||||
// in which user have never been a member
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user