Decrease total_count when get invalid recent location.

GitOrigin-RevId: 26bd0b3be1211fb2a9cad34034c54d68764b6f56
This commit is contained in:
levlam 2019-12-03 00:44:13 +03:00
parent f3dfaa6c29
commit ff1b4566f0

View File

@ -8047,12 +8047,14 @@ void MessagesManager::on_get_recent_locations(DialogId dialog_id, int32 limit, i
if (new_message != FullMessageId()) { if (new_message != FullMessageId()) {
if (new_message.get_dialog_id() != dialog_id) { if (new_message.get_dialog_id() != dialog_id) {
LOG(ERROR) << "Receive " << new_message << " instead of a message in " << dialog_id; LOG(ERROR) << "Receive " << new_message << " instead of a message in " << dialog_id;
total_count--;
continue; continue;
} }
auto m = get_message(new_message); auto m = get_message(new_message);
if (m->content->get_type() != MessageContentType::LiveLocation) { if (m->content->get_type() != MessageContentType::LiveLocation) {
LOG(ERROR) << "Receive a message of wrong type " << m->content->get_type() << " in on_get_recent_locations in " LOG(ERROR) << "Receive a message of wrong type " << m->content->get_type() << " in on_get_recent_locations in "
<< dialog_id; << dialog_id;
total_count--;
continue; continue;
} }