Add source to add_new_dialog.
This commit is contained in:
parent
55662f5db6
commit
ad17a75f28
@ -6776,7 +6776,7 @@ void MessagesManager::on_update_channel_too_long(tl_object_ptr<telegram_api::upd
|
|||||||
if (d == nullptr) {
|
if (d == nullptr) {
|
||||||
auto pts = load_channel_pts(dialog_id);
|
auto pts = load_channel_pts(dialog_id);
|
||||||
if (pts > 0) {
|
if (pts > 0) {
|
||||||
d = add_dialog(dialog_id);
|
d = add_dialog(dialog_id, "on_update_channel_too_long");
|
||||||
CHECK(d != nullptr);
|
CHECK(d != nullptr);
|
||||||
CHECK(d->pts == pts);
|
CHECK(d->pts == pts);
|
||||||
update_dialog_pos(d, "on_update_channel_too_long");
|
update_dialog_pos(d, "on_update_channel_too_long");
|
||||||
@ -7402,7 +7402,7 @@ void MessagesManager::add_pending_channel_update(DialogId dialog_id, tl_object_p
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d = add_dialog(dialog_id);
|
d = add_dialog(dialog_id, "add_pending_channel_update");
|
||||||
CHECK(d != nullptr);
|
CHECK(d != nullptr);
|
||||||
CHECK(d->pts == pts);
|
CHECK(d->pts == pts);
|
||||||
update_dialog_pos(d, "add_pending_channel_update");
|
update_dialog_pos(d, "add_pending_channel_update");
|
||||||
@ -14451,7 +14451,7 @@ void MessagesManager::on_get_dialogs(FolderId folder_id, vector<tl_object_ptr<te
|
|||||||
bool need_update_dialog_pos = false;
|
bool need_update_dialog_pos = false;
|
||||||
being_added_dialog_id_ = dialog_id;
|
being_added_dialog_id_ = dialog_id;
|
||||||
if (d == nullptr) {
|
if (d == nullptr) {
|
||||||
d = add_dialog(dialog_id);
|
d = add_dialog(dialog_id, "on_get_dialogs");
|
||||||
need_update_dialog_pos = true;
|
need_update_dialog_pos = true;
|
||||||
} else {
|
} else {
|
||||||
LOG(INFO) << "Receive already created " << dialog_id;
|
LOG(INFO) << "Receive already created " << dialog_id;
|
||||||
@ -15428,7 +15428,7 @@ bool MessagesManager::load_dialog(DialogId dialog_id, int left_tries, Promise<Un
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_dialog(dialog_id);
|
add_dialog(dialog_id, "load_dialog");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19394,7 +19394,7 @@ DialogId MessagesManager::migrate_dialog_to_megagroup(DialogId dialog_id, Promis
|
|||||||
auto new_dialog_id = DialogId(channel_id);
|
auto new_dialog_id = DialogId(channel_id);
|
||||||
Dialog *d = get_dialog_force(new_dialog_id);
|
Dialog *d = get_dialog_force(new_dialog_id);
|
||||||
if (d == nullptr) {
|
if (d == nullptr) {
|
||||||
d = add_dialog(new_dialog_id);
|
d = add_dialog(new_dialog_id, "migrate_dialog_to_megagroup");
|
||||||
if (d->pts == 0) {
|
if (d->pts == 0) {
|
||||||
d->pts = 1;
|
d->pts = 1;
|
||||||
if (is_debug_message_op_enabled()) {
|
if (is_debug_message_op_enabled()) {
|
||||||
@ -31943,7 +31943,7 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(DialogId dialog
|
|||||||
|
|
||||||
Dialog *d = get_dialog_force(dialog_id);
|
Dialog *d = get_dialog_force(dialog_id);
|
||||||
if (d == nullptr) {
|
if (d == nullptr) {
|
||||||
d = add_dialog(dialog_id);
|
d = add_dialog(dialog_id, "add_message_to_dialog");
|
||||||
*need_update_dialog_pos = true;
|
*need_update_dialog_pos = true;
|
||||||
} else {
|
} else {
|
||||||
CHECK(d->dialog_id == dialog_id);
|
CHECK(d->dialog_id == dialog_id);
|
||||||
@ -33795,7 +33795,7 @@ void MessagesManager::force_create_dialog(DialogId dialog_id, const char *source
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d = add_dialog(dialog_id);
|
d = add_dialog(dialog_id, "force_create_dialog");
|
||||||
update_dialog_pos(d, "force_create_dialog");
|
update_dialog_pos(d, "force_create_dialog");
|
||||||
|
|
||||||
if (dialog_id.get_type() == DialogType::SecretChat && !d->notification_settings.is_synchronized &&
|
if (dialog_id.get_type() == DialogType::SecretChat && !d->notification_settings.is_synchronized &&
|
||||||
@ -33855,7 +33855,7 @@ void MessagesManager::force_create_dialog(DialogId dialog_id, const char *source
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagesManager::Dialog *MessagesManager::add_dialog(DialogId dialog_id) {
|
MessagesManager::Dialog *MessagesManager::add_dialog(DialogId dialog_id, const char *source) {
|
||||||
LOG(DEBUG) << "Creating " << dialog_id;
|
LOG(DEBUG) << "Creating " << dialog_id;
|
||||||
CHECK(!have_dialog(dialog_id));
|
CHECK(!have_dialog(dialog_id));
|
||||||
|
|
||||||
@ -33864,7 +33864,7 @@ MessagesManager::Dialog *MessagesManager::add_dialog(DialogId dialog_id) {
|
|||||||
auto r_value = G()->td_db()->get_dialog_db_sync()->get_dialog(dialog_id);
|
auto r_value = G()->td_db()->get_dialog_db_sync()->get_dialog(dialog_id);
|
||||||
if (r_value.is_ok()) {
|
if (r_value.is_ok()) {
|
||||||
LOG(INFO) << "Synchronously loaded " << dialog_id << " from database";
|
LOG(INFO) << "Synchronously loaded " << dialog_id << " from database";
|
||||||
return add_new_dialog(parse_dialog(dialog_id, r_value.ok()), true);
|
return add_new_dialog(parse_dialog(dialog_id, r_value.ok()), true, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33872,10 +33872,11 @@ MessagesManager::Dialog *MessagesManager::add_dialog(DialogId dialog_id) {
|
|||||||
d->dialog_id = dialog_id;
|
d->dialog_id = dialog_id;
|
||||||
invalidate_message_indexes(d.get());
|
invalidate_message_indexes(d.get());
|
||||||
|
|
||||||
return add_new_dialog(std::move(d), false);
|
return add_new_dialog(std::move(d), false, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagesManager::Dialog *MessagesManager::add_new_dialog(unique_ptr<Dialog> &&d, bool is_loaded_from_database) {
|
MessagesManager::Dialog *MessagesManager::add_new_dialog(unique_ptr<Dialog> &&d, bool is_loaded_from_database,
|
||||||
|
const char *source) {
|
||||||
auto dialog_id = d->dialog_id;
|
auto dialog_id = d->dialog_id;
|
||||||
LOG_CHECK(is_inited_) << dialog_id << ' ' << is_loaded_from_database;
|
LOG_CHECK(is_inited_) << dialog_id << ' ' << is_loaded_from_database;
|
||||||
switch (dialog_id.get_type()) {
|
switch (dialog_id.get_type()) {
|
||||||
@ -35054,7 +35055,7 @@ MessagesManager::Dialog *MessagesManager::on_load_dialog_from_database(DialogId
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOG(INFO) << "Add new " << dialog_id << " from database";
|
LOG(INFO) << "Add new " << dialog_id << " from database";
|
||||||
return add_new_dialog(parse_dialog(dialog_id, value), true);
|
return add_new_dialog(parse_dialog(dialog_id, value), true, "on_load_dialog_from_database");
|
||||||
}
|
}
|
||||||
|
|
||||||
const DialogFilter *MessagesManager::get_server_dialog_filter(DialogFilterId dialog_filter_id) const {
|
const DialogFilter *MessagesManager::get_server_dialog_filter(DialogFilterId dialog_filter_id) const {
|
||||||
@ -35779,7 +35780,7 @@ void MessagesManager::on_get_channel_difference(
|
|||||||
|
|
||||||
bool need_update_dialog_pos = false;
|
bool need_update_dialog_pos = false;
|
||||||
if (d == nullptr) {
|
if (d == nullptr) {
|
||||||
d = add_dialog(dialog_id);
|
d = add_dialog(dialog_id, "on_get_channel_difference");
|
||||||
need_update_dialog_pos = true;
|
need_update_dialog_pos = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2404,9 +2404,9 @@ class MessagesManager : public Actor {
|
|||||||
|
|
||||||
MessageId get_message_id_by_random_id(Dialog *d, int64 random_id, const char *source);
|
MessageId get_message_id_by_random_id(Dialog *d, int64 random_id, const char *source);
|
||||||
|
|
||||||
Dialog *add_dialog(DialogId dialog_id);
|
Dialog *add_dialog(DialogId dialog_id, const char *source);
|
||||||
|
|
||||||
Dialog *add_new_dialog(unique_ptr<Dialog> &&d, bool is_loaded_from_database);
|
Dialog *add_new_dialog(unique_ptr<Dialog> &&d, bool is_loaded_from_database, const char *source);
|
||||||
|
|
||||||
void fix_new_dialog(Dialog *d, unique_ptr<Message> &&last_database_message, MessageId last_database_message_id,
|
void fix_new_dialog(Dialog *d, unique_ptr<Message> &&last_database_message, MessageId last_database_message_id,
|
||||||
int64 order, int32 last_clear_history_date, MessageId last_clear_history_message_id,
|
int64 order, int32 last_clear_history_date, MessageId last_clear_history_message_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user