Fix calls to before_get_difference.
GitOrigin-RevId: 936f232a2e5300fcbf3c4e9c9e235a303fe59fe4
This commit is contained in:
parent
254007eab8
commit
95db580cd3
@ -623,7 +623,7 @@ void CallActor::flush_call_state() {
|
|||||||
}
|
}
|
||||||
call_state_need_flush_ = false;
|
call_state_need_flush_ = false;
|
||||||
|
|
||||||
// can't call const function
|
// TODO can't call const function
|
||||||
// send_closure(G()->contacts_manager(), &ContactsManager::get_user_id_object, user_id_, "flush_call_state");
|
// send_closure(G()->contacts_manager(), &ContactsManager::get_user_id_object, user_id_, "flush_call_state");
|
||||||
send_closure(G()->td(), &Td::send_update,
|
send_closure(G()->td(), &Td::send_update,
|
||||||
make_tl_object<td_api::updateCall>(
|
make_tl_object<td_api::updateCall>(
|
||||||
|
@ -21625,6 +21625,7 @@ void MessagesManager::force_create_dialog(DialogId dialog_id, const char *source
|
|||||||
auto user_id = td_->contacts_manager_->get_secret_chat_user_id(dialog_id.get_secret_chat_id());
|
auto user_id = td_->contacts_manager_->get_secret_chat_user_id(dialog_id.get_secret_chat_id());
|
||||||
Dialog *user_d = get_dialog_force(DialogId(user_id));
|
Dialog *user_d = get_dialog_force(DialogId(user_id));
|
||||||
if (user_d != nullptr && user_d->notification_settings.is_synchronized) {
|
if (user_d != nullptr && user_d->notification_settings.is_synchronized) {
|
||||||
|
LOG(INFO) << "Copy notification settings from " << user_d->dialog_id << " to " << dialog_id;
|
||||||
update_dialog_notification_settings(dialog_id, &d->notification_settings, user_d->notification_settings);
|
update_dialog_notification_settings(dialog_id, &d->notification_settings, user_d->notification_settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3025,7 +3025,7 @@ void Td::on_online_updated(bool force, bool send_update) {
|
|||||||
}
|
}
|
||||||
if (is_online_) {
|
if (is_online_) {
|
||||||
alarm_timeout_.set_timeout_in(ONLINE_ALARM_ID,
|
alarm_timeout_.set_timeout_in(ONLINE_ALARM_ID,
|
||||||
G()->shared_config().get_option_integer("online_update_period_ms", 120000) * 1e-3);
|
G()->shared_config().get_option_integer("online_update_period_ms", 210000) * 1e-3);
|
||||||
} else {
|
} else {
|
||||||
alarm_timeout_.cancel_timeout(ONLINE_ALARM_ID);
|
alarm_timeout_.cancel_timeout(ONLINE_ALARM_ID);
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ void UpdatesManager::get_difference(const char *source) {
|
|||||||
|
|
||||||
VLOG(get_difference) << "-----BEGIN GET DIFFERENCE----- from " << source;
|
VLOG(get_difference) << "-----BEGIN GET DIFFERENCE----- from " << source;
|
||||||
|
|
||||||
before_get_difference();
|
before_get_difference(false);
|
||||||
|
|
||||||
td_->create_handler<GetDifferenceQuery>()->send();
|
td_->create_handler<GetDifferenceQuery>()->send();
|
||||||
last_get_difference_pts_ = get_pts();
|
last_get_difference_pts_ = get_pts();
|
||||||
@ -257,12 +257,14 @@ void UpdatesManager::get_difference(const char *source) {
|
|||||||
set_state(State::Type::RunningGetDifference);
|
set_state(State::Type::RunningGetDifference);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdatesManager::before_get_difference() {
|
void UpdatesManager::before_get_difference(bool is_initial) {
|
||||||
// may be called many times before after_get_difference is called
|
// may be called many times before after_get_difference is called
|
||||||
send_closure(G()->state_manager(), &StateManager::on_synchronized, false);
|
send_closure(G()->state_manager(), &StateManager::on_synchronized, false);
|
||||||
|
|
||||||
td_->messages_manager_->before_get_difference();
|
td_->messages_manager_->before_get_difference();
|
||||||
|
if (!is_initial) {
|
||||||
send_closure(td_->secret_chats_manager_, &SecretChatsManager::before_get_difference, get_qts());
|
send_closure(td_->secret_chats_manager_, &SecretChatsManager::before_get_difference, get_qts());
|
||||||
|
}
|
||||||
send_closure_later(td_->notification_manager_actor_, &NotificationManager::before_get_difference);
|
send_closure_later(td_->notification_manager_actor_, &NotificationManager::before_get_difference);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -901,7 +903,9 @@ void UpdatesManager::init_state() {
|
|||||||
if (pts_str.empty()) {
|
if (pts_str.empty()) {
|
||||||
if (!running_get_difference_) {
|
if (!running_get_difference_) {
|
||||||
running_get_difference_ = true;
|
running_get_difference_ = true;
|
||||||
send_closure(G()->state_manager(), &StateManager::on_synchronized, false);
|
|
||||||
|
before_get_difference(true);
|
||||||
|
|
||||||
td_->create_handler<GetUpdatesStateQuery>()->send();
|
td_->create_handler<GetUpdatesStateQuery>()->send();
|
||||||
|
|
||||||
set_state(State::Type::RunningGetUpdatesState);
|
set_state(State::Type::RunningGetUpdatesState);
|
||||||
|
@ -171,7 +171,7 @@ class UpdatesManager : public Actor {
|
|||||||
|
|
||||||
void on_failed_get_difference();
|
void on_failed_get_difference();
|
||||||
|
|
||||||
void before_get_difference();
|
void before_get_difference(bool is_initial);
|
||||||
|
|
||||||
void after_get_difference();
|
void after_get_difference();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user