Add check that there are no two new chats added simultaneously.
This commit is contained in:
parent
70050704d2
commit
5a1a64764b
@ -35953,6 +35953,9 @@ MessagesManager::Dialog *MessagesManager::add_new_dialog(unique_ptr<Dialog> &&d,
|
||||
|
||||
auto dialog_it = dialogs_.emplace(dialog_id, std::move(d)).first;
|
||||
|
||||
CHECK(!being_added_new_dialog_id_.is_valid());
|
||||
being_added_new_dialog_id_ = dialog_id;
|
||||
|
||||
loaded_dialogs_.erase(dialog_id);
|
||||
|
||||
Dialog *dialog = dialog_it->second.get();
|
||||
@ -35961,6 +35964,8 @@ MessagesManager::Dialog *MessagesManager::add_new_dialog(unique_ptr<Dialog> &&d,
|
||||
|
||||
send_update_new_chat(dialog);
|
||||
|
||||
being_added_new_dialog_id_ = DialogId();
|
||||
|
||||
fix_new_dialog(dialog, std::move(last_database_message), last_database_message_id, order, last_clear_history_date,
|
||||
last_clear_history_message_id, default_join_group_call_as_dialog_id, default_send_message_as_dialog_id,
|
||||
need_drop_default_send_message_as_dialog_id, is_loaded_from_database);
|
||||
@ -36094,6 +36099,7 @@ void MessagesManager::fix_new_dialog(Dialog *d, unique_ptr<Message> &&last_datab
|
||||
CHECK(counter_message.first > 0);
|
||||
counter_message.first--;
|
||||
if (counter_message.first == 0) {
|
||||
LOG(INFO) << "Add postponed last database message in " << pending_dialog_id;
|
||||
add_dialog_last_database_message(get_dialog(pending_dialog_id), std::move(counter_message.second));
|
||||
pending_add_dialog_last_database_message_.erase(pending_dialog_id);
|
||||
}
|
||||
|
@ -3679,6 +3679,7 @@ class MessagesManager final : public Actor {
|
||||
|
||||
DialogId being_added_dialog_id_;
|
||||
DialogId being_added_by_new_message_dialog_id_;
|
||||
DialogId being_added_new_dialog_id_;
|
||||
|
||||
DialogId debug_channel_difference_dialog_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user