Avoid some initialization for bots.
This commit is contained in:
parent
e7fbcd9d2a
commit
a262f0a5f7
@ -418,7 +418,6 @@ void AnimationsManager::on_update_animation_search_emojis() {
|
||||
return;
|
||||
}
|
||||
if (td_->auth_manager_->is_bot()) {
|
||||
td_->option_manager_->set_option_empty("animation_search_emojis");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -437,7 +436,6 @@ void AnimationsManager::on_update_animation_search_provider() {
|
||||
return;
|
||||
}
|
||||
if (td_->auth_manager_->is_bot()) {
|
||||
td_->option_manager_->set_option_empty("animation_search_provider");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -455,6 +453,9 @@ void AnimationsManager::on_update_saved_animations_limit() {
|
||||
if (G()->close_flag()) {
|
||||
return;
|
||||
}
|
||||
if (td_->auth_manager_->is_bot()) {
|
||||
return;
|
||||
}
|
||||
auto saved_animations_limit =
|
||||
narrow_cast<int32>(td_->option_manager_->get_option_integer("saved_animations_limit", 200));
|
||||
if (saved_animations_limit != saved_animations_limit_) {
|
||||
|
@ -2967,7 +2967,7 @@ ContactsManager::ContactsManager(Td *td, ActorShared<> parent) : td_(td), parent
|
||||
if (!saved_contact_count_string.empty()) {
|
||||
saved_contact_count_ = to_integer<int32>(saved_contact_count_string);
|
||||
}
|
||||
} else {
|
||||
} else if (!td_->auth_manager_->is_bot()) {
|
||||
G()->td_db()->get_binlog_pmc()->erase("next_contacts_sync_date");
|
||||
G()->td_db()->get_binlog_pmc()->erase("saved_contact_count");
|
||||
}
|
||||
@ -2978,27 +2978,29 @@ ContactsManager::ContactsManager(Td *td, ActorShared<> parent) : td_(td), parent
|
||||
}
|
||||
}
|
||||
|
||||
was_online_local_ = to_integer<int32>(G()->td_db()->get_binlog_pmc()->get("my_was_online_local"));
|
||||
was_online_remote_ = to_integer<int32>(G()->td_db()->get_binlog_pmc()->get("my_was_online_remote"));
|
||||
auto unix_time = G()->unix_time();
|
||||
if (was_online_local_ >= unix_time && !td_->is_online()) {
|
||||
was_online_local_ = unix_time - 1;
|
||||
}
|
||||
if (!td_->auth_manager_->is_bot()) {
|
||||
was_online_local_ = to_integer<int32>(G()->td_db()->get_binlog_pmc()->get("my_was_online_local"));
|
||||
was_online_remote_ = to_integer<int32>(G()->td_db()->get_binlog_pmc()->get("my_was_online_remote"));
|
||||
auto unix_time = G()->unix_time();
|
||||
if (was_online_local_ >= unix_time && !td_->is_online()) {
|
||||
was_online_local_ = unix_time - 1;
|
||||
}
|
||||
|
||||
location_visibility_expire_date_ =
|
||||
to_integer<int32>(G()->td_db()->get_binlog_pmc()->get("location_visibility_expire_date"));
|
||||
if (location_visibility_expire_date_ != 0 && location_visibility_expire_date_ <= G()->unix_time()) {
|
||||
location_visibility_expire_date_ = 0;
|
||||
G()->td_db()->get_binlog_pmc()->erase("location_visibility_expire_date");
|
||||
location_visibility_expire_date_ =
|
||||
to_integer<int32>(G()->td_db()->get_binlog_pmc()->get("location_visibility_expire_date"));
|
||||
if (location_visibility_expire_date_ != 0 && location_visibility_expire_date_ <= G()->unix_time()) {
|
||||
location_visibility_expire_date_ = 0;
|
||||
G()->td_db()->get_binlog_pmc()->erase("location_visibility_expire_date");
|
||||
}
|
||||
auto pending_location_visibility_expire_date_string =
|
||||
G()->td_db()->get_binlog_pmc()->get("pending_location_visibility_expire_date");
|
||||
if (!pending_location_visibility_expire_date_string.empty()) {
|
||||
pending_location_visibility_expire_date_ = to_integer<int32>(pending_location_visibility_expire_date_string);
|
||||
}
|
||||
update_is_location_visible();
|
||||
LOG(INFO) << "Loaded location_visibility_expire_date = " << location_visibility_expire_date_
|
||||
<< " and pending_location_visibility_expire_date = " << pending_location_visibility_expire_date_;
|
||||
}
|
||||
auto pending_location_visibility_expire_date_string =
|
||||
G()->td_db()->get_binlog_pmc()->get("pending_location_visibility_expire_date");
|
||||
if (!pending_location_visibility_expire_date_string.empty()) {
|
||||
pending_location_visibility_expire_date_ = to_integer<int32>(pending_location_visibility_expire_date_string);
|
||||
}
|
||||
update_is_location_visible();
|
||||
LOG(INFO) << "Loaded location_visibility_expire_date = " << location_visibility_expire_date_
|
||||
<< " and pending_location_visibility_expire_date = " << pending_location_visibility_expire_date_;
|
||||
|
||||
user_online_timeout_.set_callback(on_user_online_timeout_callback);
|
||||
user_online_timeout_.set_callback_data(static_cast<void *>(this));
|
||||
|
@ -1647,9 +1647,11 @@ class StickersManager::UploadStickerFileCallback final : public FileManager::Upl
|
||||
StickersManager::StickersManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) {
|
||||
upload_sticker_file_callback_ = std::make_shared<UploadStickerFileCallback>();
|
||||
|
||||
on_update_animated_emoji_zoom();
|
||||
on_update_recent_stickers_limit();
|
||||
on_update_favorite_stickers_limit();
|
||||
if (!td_->auth_manager_->is_bot()) {
|
||||
on_update_animated_emoji_zoom();
|
||||
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();
|
||||
|
@ -1146,7 +1146,7 @@ class StickersManager final : public Actor {
|
||||
|
||||
WaitFreeHashMap<CustomEmojiId, FileId, CustomEmojiIdHash> custom_emoji_to_sticker_id_;
|
||||
|
||||
double animated_emoji_zoom_ = 0.0;
|
||||
double animated_emoji_zoom_ = 0.625;
|
||||
|
||||
bool disable_animated_emojis_ = false;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user