Move setting of default option values from ContactsManager to OptionManager.
This commit is contained in:
parent
13c94c7731
commit
f24bc41596
@ -2957,15 +2957,6 @@ ContactsManager::ContactsManager(Td *td, ActorShared<> parent) : td_(td), parent
|
||||
|
||||
my_id_ = load_my_id();
|
||||
|
||||
td_->option_manager_->set_option_integer("telegram_service_notifications_chat_id",
|
||||
DialogId(get_service_notifications_user_id()).get());
|
||||
td_->option_manager_->set_option_integer("replies_bot_chat_id", DialogId(get_replies_bot_user_id()).get());
|
||||
td_->option_manager_->set_option_integer("group_anonymous_bot_user_id", get_anonymous_bot_user_id().get());
|
||||
td_->option_manager_->set_option_integer("channel_bot_user_id", get_channel_bot_user_id().get());
|
||||
if (!td_->option_manager_->have_option("anti_spam_bot_user_id")) {
|
||||
td_->option_manager_->set_option_integer("anti_spam_bot_user_id", get_anti_spam_bot_user_id().get());
|
||||
}
|
||||
|
||||
if (G()->use_chat_info_database()) {
|
||||
auto next_contacts_sync_date_string = G()->td_db()->get_binlog_pmc()->get("next_contacts_sync_date");
|
||||
if (!next_contacts_sync_date_string.empty()) {
|
||||
|
@ -81,7 +81,7 @@ OptionManager::OptionManager(Td *td)
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
td_api::make_object<td_api::updateOption>("utc_time_offset", get_option_value_object(utc_time_offset)));
|
||||
|
||||
auto set_default_integer_option = [&](string name, int32 value) {
|
||||
auto set_default_integer_option = [&](string name, int64 value) {
|
||||
if (options.isset(name)) {
|
||||
return;
|
||||
}
|
||||
@ -95,6 +95,12 @@ OptionManager::OptionManager(Td *td)
|
||||
td_api::make_object<td_api::updateOption>(name, td_api::make_object<td_api::optionValueInteger>(value)));
|
||||
}
|
||||
};
|
||||
set_default_integer_option("telegram_service_notifications_chat_id",
|
||||
DialogId(ContactsManager::get_service_notifications_user_id()).get());
|
||||
set_default_integer_option("replies_bot_chat_id", DialogId(ContactsManager::get_replies_bot_user_id()).get());
|
||||
set_default_integer_option("group_anonymous_bot_user_id", ContactsManager::get_anonymous_bot_user_id().get());
|
||||
set_default_integer_option("channel_bot_user_id", ContactsManager::get_channel_bot_user_id().get());
|
||||
set_default_integer_option("anti_spam_bot_user_id", ContactsManager::get_anti_spam_bot_user_id().get());
|
||||
set_default_integer_option("message_caption_length_max", 1024);
|
||||
set_default_integer_option("message_reply_quote_length_max", 1024);
|
||||
set_default_integer_option("story_caption_length_max", 200);
|
||||
|
Loading…
x
Reference in New Issue
Block a user