From 9d7d04e159f9743783fc921ef1564bc0a3e38405 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 31 May 2020 22:31:27 +0300 Subject: [PATCH] Improve logging. GitOrigin-RevId: a3ac8554a60048ecfadddc3c6d4054c759beefba --- td/telegram/MessagesManager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 04a757de4..8d89c1b0f 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -10104,10 +10104,12 @@ void MessagesManager::read_history_inbox(DialogId dialog_id, MessageId max_messa if (max_message_id != MessageId() && unread_count > 0 && max_message_id >= d->last_new_message_id && max_message_id >= d->last_message_id && max_message_id >= d->last_database_message_id) { - LOG(ERROR) << "Have unknown " << unread_count << " unread messages up to " << max_message_id << " in " - << dialog_id << " with last_new_message_id = " << d->last_new_message_id - << ", last_message_id = " << d->last_message_id - << ", last_database_message_id = " << d->last_database_message_id; + if (d->last_new_message_id.is_valid()) { + LOG(ERROR) << "Have unknown " << unread_count << " unread messages up to " << max_message_id << " in " + << dialog_id << " with last_new_message_id = " << d->last_new_message_id + << ", last_message_id = " << d->last_message_id + << ", last_database_message_id = " << d->last_database_message_id; + } unread_count = 0; }