From bc94db66d071e76ca3e2df3ce5d284a4b7ebe3df Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 29 Aug 2020 01:56:47 +0300 Subject: [PATCH] Improve logging in MessagesManager::set_dialog_order. GitOrigin-RevId: 6509408a28ed063ecc4d9d48b0dedfeb1d854e7f --- td/telegram/MessagesManager.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 694be6c57..5b4321977 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -30917,9 +30917,18 @@ bool MessagesManager::set_dialog_order(Dialog *d, int64 new_order, bool need_sen DialogDate old_date(d->order, dialog_id); DialogDate new_date(new_order, dialog_id); - auto &folder = *get_dialog_folder(d->folder_id); if (old_date == new_date) { - LOG(INFO) << "Order of " << d->dialog_id << " is still " << new_order << " from " << source; + LOG(INFO) << "Order of " << d->dialog_id << " from " << d->folder_id << " is still " << new_order << " from " + << source; + } else { + LOG(INFO) << "Update order of " << dialog_id << " from " << d->folder_id << " from " << d->order << " to " + << new_order << " from " << source; + } + + auto folder_ptr = get_dialog_folder(d->folder_id); + CHECK(folder_ptr != nullptr); + auto &folder = *folder_ptr; + if (old_date == new_date) { if (new_order == DEFAULT_ORDER) { // first addition of a new left dialog if (folder.ordered_dialogs_.insert(new_date).second) { @@ -30934,8 +30943,6 @@ bool MessagesManager::set_dialog_order(Dialog *d, int64 new_order, bool need_sen return false; } - LOG(INFO) << "Update order of " << dialog_id << " from " << d->order << " to " << new_order << " from " << source; - auto dialog_positions = get_dialog_positions(d); if (folder.ordered_dialogs_.erase(old_date) == 0) {