Do not add file source from self-destructing messages.
GitOrigin-RevId: 5ac703d188ec532a52efa8549ee8c7e63a78a78b
This commit is contained in:
parent
5c0be2f24f
commit
00a70b466d
@ -16653,6 +16653,10 @@ FileSourceId MessagesManager::get_message_file_source_id(FullMessageId full_mess
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MessagesManager::add_message_file_sources(DialogId dialog_id, const Message *m) {
|
void MessagesManager::add_message_file_sources(DialogId dialog_id, const Message *m) {
|
||||||
|
if (dialog_id.get_type() != DialogType::SecretChat && m->is_content_secret) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto file_ids = get_message_content_file_ids(m->content.get(), td_);
|
auto file_ids = get_message_content_file_ids(m->content.get(), td_);
|
||||||
if (file_ids.empty()) {
|
if (file_ids.empty()) {
|
||||||
return;
|
return;
|
||||||
@ -16683,6 +16687,10 @@ void MessagesManager::remove_message_file_sources(DialogId dialog_id, const Mess
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MessagesManager::change_message_files(DialogId dialog_id, const Message *m, const vector<FileId> &old_file_ids) {
|
void MessagesManager::change_message_files(DialogId dialog_id, const Message *m, const vector<FileId> &old_file_ids) {
|
||||||
|
if (dialog_id.get_type() != DialogType::SecretChat && m->is_content_secret) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto new_file_ids = get_message_content_file_ids(m->content.get(), td_);
|
auto new_file_ids = get_message_content_file_ids(m->content.get(), td_);
|
||||||
if (new_file_ids == old_file_ids) {
|
if (new_file_ids == old_file_ids) {
|
||||||
return;
|
return;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "td/telegram/files/FileManager.h"
|
#include "td/telegram/files/FileManager.h"
|
||||||
|
|
||||||
#include "td/telegram/telegram_api.h"
|
#include "td/telegram/telegram_api.h"
|
||||||
@ -2620,7 +2621,6 @@ void FileManager::run_upload(FileNodePtr node, std::vector<int> bad_parts) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FileView file_view(node);
|
FileView file_view(node);
|
||||||
if (!file_view.has_local_location() && !file_view.has_remote_location()) {
|
if (!file_view.has_local_location() && !file_view.has_remote_location()) {
|
||||||
if (node->get_by_hash_ || node->generate_id_ == 0 || !node->generate_was_update_) {
|
if (node->get_by_hash_ || node->generate_id_ == 0 || !node->generate_was_update_) {
|
||||||
|
Loading…
Reference in New Issue
Block a user