From 35d039f42f98ecae3ce96c8a3681225f608435fb Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 3 Feb 2018 18:41:10 +0300 Subject: [PATCH] Add some debug logginh. GitOrigin-RevId: 462cf5c2f80f708ae2494b037538241f31d08ca3 --- td/telegram/MessageEntity.cpp | 4 ++++ td/telegram/MessagesManager.cpp | 5 ++++- td/telegram/UpdatesManager.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/td/telegram/MessageEntity.cpp b/td/telegram/MessageEntity.cpp index 30e34caf..3a50e195 100644 --- a/td/telegram/MessageEntity.cpp +++ b/td/telegram/MessageEntity.cpp @@ -1722,6 +1722,10 @@ vector get_message_entities(const ContactsManager *contacts_manag LOG(ERROR) << "Receive unknown " << user_id << " in MentionName"; continue; } + if (!contacts_manager->have_input_user(user_id)) { + LOG(ERROR) << "Receive unaccessible " << user_id << " in MentionName"; + continue; + } entities.emplace_back(entity_mention_name->offset_, entity_mention_name->length_, user_id); break; } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index f58eef65..fe177506 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -6483,7 +6483,10 @@ void MessagesManager::on_get_history(DialogId dialog_id, MessageId from_message_ } is_dialog_updated = true; } else { - CHECK(d->last_new_message_id.is_valid()); + CHECK(d->last_new_message_id.is_valid()) + << dialog_id << " " << from_the_end << " " << d->first_database_message_id << " " + << d->last_database_message_id << " " << first_added_message_id << " " << last_added_message_id << " " + << d->last_message_id; CHECK(d->first_database_message_id.is_valid()); { MessagesConstIterator it(d, d->first_database_message_id); diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index b8e81b85..a3e3dfdf 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -329,7 +329,7 @@ bool UpdatesManager::is_acceptable_message_entities( if (entity->get_id() == telegram_api::messageEntityMentionName::ID) { auto entity_mention_name = static_cast(entity.get()); UserId user_id(entity_mention_name->user_id_); - if (!td_->contacts_manager_->have_user(user_id)) { + if (!td_->contacts_manager_->have_user(user_id) || !td_->contacts_manager_->have_input_user(user_id)) { return false; } }