Improve logging.

GitOrigin-RevId: 4c5be88bb5f89b50ca1872a8a6686b777fe8aaa2
This commit is contained in:
levlam 2020-01-06 04:45:05 +03:00
parent fe28551d4c
commit c627c79b6a

View File

@ -18772,9 +18772,14 @@ void MessagesManager::on_upload_message_media_finished(int64 media_album_id, Dia
auto &request = it->second;
CHECK(request.dialog_id == dialog_id);
auto message_it = std::find(request.message_ids.begin(), request.message_ids.end(), message_id);
LOG_CHECK(message_it != request.message_ids.end())
<< dialog_id << ' ' << request.message_ids << ' ' << message_id << ' ' << request.finished_count << ' '
<< request.is_finished << ' ' << request.results;
if (message_it == request.message_ids.end()) {
// the message may be already deleted and the album is recreated without it
CHECK(message_id.is_yet_unsent());
LOG_CHECK(get_message({dialog_id, message_id}) == nullptr)
<< dialog_id << ' ' << request.message_ids << ' ' << message_id << ' ' << request.finished_count << ' '
<< request.is_finished << ' ' << request.results;
return;
}
auto pos = static_cast<size_t>(message_it - request.message_ids.begin());
if (request.is_finished[pos]) {