From 0578d58d9367ecb9a65e8a380ff2f74351b61419 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 19 Mar 2020 01:54:59 +0300 Subject: [PATCH] Minor improvements. GitOrigin-RevId: 6c87ee82034d077c1f16f053948a0d89b4c2cd71 --- td/telegram/MessagesManager.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 1d0b9f010..3db8adede 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -10347,15 +10347,10 @@ void MessagesManager::init() { LOG(ERROR) << "Can't parse " << sponsored_dialog_id_string; } else { sponsored_dialog_id_ = DialogId(r_dialog_id.ok()); - if (!sponsored_dialog_id_.is_valid()) { - LOG(ERROR) << "Have invalid chat ID " << sponsored_dialog_id_string; + Dialog *d = get_dialog_force(sponsored_dialog_id_); + if (d == nullptr) { + LOG(ERROR) << "Can't load " << sponsored_dialog_id_; sponsored_dialog_id_ = DialogId(); - } else { - Dialog *d = get_dialog_force(sponsored_dialog_id_); - if (d == nullptr) { - LOG(ERROR) << "Can't load " << sponsored_dialog_id_; - sponsored_dialog_id_ = DialogId(); - } } } } @@ -28287,7 +28282,8 @@ bool MessagesManager::set_dialog_order(Dialog *d, int64 new_order, bool need_sen LOG_IF(ERROR, d->order != DEFAULT_ORDER) << dialog_id << " not found in the chat list from " << source; } LOG_IF(ERROR, is_loaded_from_database && d->order != DEFAULT_ORDER) - << dialog_id << " has non-default order after loading from database from " << source; + << dialog_id << " has order " << new_order << " instead of saved to database order " << d->order + << " after loading from " << source; int64 updated_to = 0; if (new_date <= list.last_dialog_date_) {