Increase logevent_id_generation before sending server request.
GitOrigin-RevId: ebb1bdb8b3802b0b2cd6c55c9b85817c219c222a
This commit is contained in:
parent
6babab76f0
commit
e09979d8ac
@ -12772,6 +12772,7 @@ void MessagesManager::save_dialog_draft_message_on_server(DialogId dialog_id) {
|
|||||||
|
|
||||||
Promise<> promise;
|
Promise<> promise;
|
||||||
if (d->save_draft_message_logevent_id != 0) {
|
if (d->save_draft_message_logevent_id != 0) {
|
||||||
|
d->save_draft_message_logevent_id_generation++;
|
||||||
promise = PromiseCreator::lambda([actor_id = actor_id(this), dialog_id,
|
promise = PromiseCreator::lambda([actor_id = actor_id(this), dialog_id,
|
||||||
generation = d->save_draft_message_logevent_id_generation](Result<Unit> result) {
|
generation = d->save_draft_message_logevent_id_generation](Result<Unit> result) {
|
||||||
if (!G()->close_flag()) {
|
if (!G()->close_flag()) {
|
||||||
@ -13133,6 +13134,7 @@ void MessagesManager::update_dialog_notification_settings_on_server(DialogId dia
|
|||||||
|
|
||||||
Promise<> promise;
|
Promise<> promise;
|
||||||
if (d->save_notification_settings_logevent_id != 0) {
|
if (d->save_notification_settings_logevent_id != 0) {
|
||||||
|
d->save_notification_settings_logevent_id_generation++;
|
||||||
promise = PromiseCreator::lambda(
|
promise = PromiseCreator::lambda(
|
||||||
[actor_id = actor_id(this), dialog_id,
|
[actor_id = actor_id(this), dialog_id,
|
||||||
generation = d->save_notification_settings_logevent_id_generation](Result<Unit> result) {
|
generation = d->save_notification_settings_logevent_id_generation](Result<Unit> result) {
|
||||||
@ -14297,6 +14299,7 @@ void MessagesManager::read_history_on_server_impl(DialogId dialog_id, MessageId
|
|||||||
|
|
||||||
Promise<> promise;
|
Promise<> promise;
|
||||||
if (d->read_history_logevent_id != 0) {
|
if (d->read_history_logevent_id != 0) {
|
||||||
|
d->read_history_logevent_id_generation++;
|
||||||
promise = PromiseCreator::lambda([actor_id = actor_id(this), dialog_id,
|
promise = PromiseCreator::lambda([actor_id = actor_id(this), dialog_id,
|
||||||
generation = d->read_history_logevent_id_generation](Result<Unit> result) {
|
generation = d->read_history_logevent_id_generation](Result<Unit> result) {
|
||||||
if (!G()->close_flag()) {
|
if (!G()->close_flag()) {
|
||||||
@ -26514,7 +26517,6 @@ void MessagesManager::on_binlog_events(vector<BinlogEvent> &&events) {
|
|||||||
binlog_erase(G()->td_db()->get_binlog(), d->read_history_logevent_id);
|
binlog_erase(G()->td_db()->get_binlog(), d->read_history_logevent_id);
|
||||||
}
|
}
|
||||||
d->read_history_logevent_id = event.id_;
|
d->read_history_logevent_id = event.id_;
|
||||||
d->read_history_logevent_id_generation++;
|
|
||||||
|
|
||||||
read_history_on_server_impl(dialog_id, log_event.max_message_id_);
|
read_history_on_server_impl(dialog_id, log_event.max_message_id_);
|
||||||
break;
|
break;
|
||||||
@ -26541,7 +26543,6 @@ void MessagesManager::on_binlog_events(vector<BinlogEvent> &&events) {
|
|||||||
binlog_erase(G()->td_db()->get_binlog(), d->read_history_logevent_id);
|
binlog_erase(G()->td_db()->get_binlog(), d->read_history_logevent_id);
|
||||||
}
|
}
|
||||||
d->read_history_logevent_id = event.id_;
|
d->read_history_logevent_id = event.id_;
|
||||||
d->read_history_logevent_id_generation++;
|
|
||||||
d->last_read_inbox_message_date = log_event.max_date_;
|
d->last_read_inbox_message_date = log_event.max_date_;
|
||||||
|
|
||||||
read_history_on_server_impl(dialog_id, MessageId());
|
read_history_on_server_impl(dialog_id, MessageId());
|
||||||
@ -26663,7 +26664,6 @@ void MessagesManager::on_binlog_events(vector<BinlogEvent> &&events) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
d->save_draft_message_logevent_id = event.id_;
|
d->save_draft_message_logevent_id = event.id_;
|
||||||
d->save_draft_message_logevent_id_generation++;
|
|
||||||
|
|
||||||
save_dialog_draft_message_on_server(dialog_id);
|
save_dialog_draft_message_on_server(dialog_id);
|
||||||
break;
|
break;
|
||||||
@ -26684,7 +26684,6 @@ void MessagesManager::on_binlog_events(vector<BinlogEvent> &&events) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
d->save_notification_settings_logevent_id = event.id_;
|
d->save_notification_settings_logevent_id = event.id_;
|
||||||
d->save_notification_settings_logevent_id_generation++;
|
|
||||||
|
|
||||||
update_dialog_notification_settings_on_server(dialog_id, true);
|
update_dialog_notification_settings_on_server(dialog_id, true);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user