diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index a7f89ebf1..26f078fde 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -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() || diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index 67c2d1e77..335e6608d 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -1327,6 +1327,7 @@ Result 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 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();