Silence expected warning for bots.

GitOrigin-RevId: 685f85d18bd346088d6d22e207775e8f58e22a2a
This commit is contained in:
levlam 2019-04-22 01:06:24 +03:00
parent 31ad3ee86f
commit b63d6124f0

View File

@ -22396,6 +22396,9 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(Dialog *d, uniq
if (*need_update) { if (*need_update) {
*need_update = false; *need_update = false;
if (!G()->parameters().use_message_db) { if (!G()->parameters().use_message_db) {
// can happen for bots if the message is received first through getMessage in an unknown chat without
// last_new_message_id and only after that received through getDifference or getChannelDifference
if (last_new_message_id.is_valid()) {
LOG(ERROR) << "Receive again " << (message->is_outgoing ? "outgoing" : "incoming") LOG(ERROR) << "Receive again " << (message->is_outgoing ? "outgoing" : "incoming")
<< (message->forward_info == nullptr ? " not" : "") << " forwarded " << message_id << (message->forward_info == nullptr ? " not" : "") << " forwarded " << message_id
<< " with content of type " << message_content_type << " in " << dialog_id << " from " << source << " with content of type " << message_content_type << " in " << dialog_id << " from " << source
@ -22403,6 +22406,7 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(Dialog *d, uniq
dump_debug_message_op(d, 1); dump_debug_message_op(d, 1);
} }
} }
}
if (auto_attach) { if (auto_attach) {
CHECK(message->have_previous); CHECK(message->have_previous);
CHECK(message->have_next); CHECK(message->have_next);
@ -24846,7 +24850,7 @@ void MessagesManager::on_get_channel_dialog(DialogId dialog_id, MessageId last_m
// TODO properly support last_message_id.get() <= d->last_new_message_id.get() // TODO properly support last_message_id.get() <= d->last_new_message_id.get()
if (last_message_id.get() > d->last_new_message_id.get()) { // if last message is really a new message if (last_message_id.get() > d->last_new_message_id.get()) { // if last message is really a new message
if (!d->last_new_message_id.is_valid() && last_message_id.get() <= max_added_message_id.get()) { if (!d->last_new_message_id.is_valid() && last_message_id.get() <= d->max_added_message_id.get()) {
set_dialog_last_new_message_id(d, last_message_id, "on_get_channel_dialog 15"); // remove too new messages set_dialog_last_new_message_id(d, last_message_id, "on_get_channel_dialog 15"); // remove too new messages
} }
d->last_new_message_id = MessageId(); d->last_new_message_id = MessageId();