Add more logging.

GitOrigin-RevId: 4e84e89517d3e28911f8d876fe3ccc6ef741c4f5
This commit is contained in:
levlam 2019-11-17 01:43:47 +03:00
parent bda15f31e4
commit 35bf5e2f32
2 changed files with 8 additions and 0 deletions

View File

@ -2958,12 +2958,17 @@ void merge_message_contents(Td *td, const MessageContent *old_content, MessageCo
}
}
LOG(DEBUG) << "Merge photos " << old_photo->photos << " and " << new_photo->photos
<< " with new photos size = " << new_photos_size << ", need_merge = " << need_merge
<< ", need_update = " << need_update;
if (need_merge && new_photos_size != 0) {
FileId old_file_id = get_message_content_upload_file_id(old_content);
FileView old_file_view = td->file_manager_->get_file_view(old_file_id);
FileId new_file_id = new_photo->photos[0].file_id;
FileView new_file_view = td->file_manager_->get_file_view(new_file_id);
CHECK(new_file_view.has_remote_location());
LOG(DEBUG) << "Trying to merge old file " << old_file_id << " and new file " << new_file_id;
if (new_file_view.remote_location().is_web()) {
LOG(ERROR) << "Have remote web photo location";
} else if (!old_file_view.has_remote_location() ||

View File

@ -1327,6 +1327,7 @@ Result<FileId> FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sy
}
if (!y_file_id.is_valid()) {
LOG(DEBUG) << "Old file is invalid";
return x_node->main_file_id_;
}
FileNodePtr y_node = get_file_node(y_file_id);
@ -1338,6 +1339,7 @@ Result<FileId> FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sy
x_node->set_upload_pause(FileId());
}
if (x_node.get() == y_node.get()) {
LOG(DEBUG) << "Files are already merged";
return x_node->main_file_id_;
}
if (y_file_id == y_node->upload_pause_) {
@ -2422,6 +2424,7 @@ void FileManager::delete_file_reference(FileId file_id, string file_reference) {
if (remote != nullptr) {
VLOG(file_references) << "Do delete file reference of remote file " << file_id;
if (remote->delete_file_reference(file_reference)) {
VLOG(file_references) << "Successfully deleted file reference of remote file " << file_id;
node->upload_was_update_file_reference_ = false;
node->download_was_update_file_reference_ = false;
node->on_pmc_changed();