From 497bc9006a7af3289e4e9dd36cc7ead3fd1ab9b9 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 15 Apr 2022 14:37:01 +0300 Subject: [PATCH] Support setting files from secret chats as ringtones. --- td/telegram/files/FileManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index 3a1309a67..f783402c3 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -3083,7 +3083,8 @@ Result FileManager::check_input_file_id(FileType type, Result re if (!is_encrypted && !is_secure) { if (real_type != type && !(real_type == FileType::Temp && file_view.has_url()) && !(is_document_type(real_type) && is_document_type(type)) && - !(is_background_type(real_type) && is_background_type(type))) { + !(is_background_type(real_type) && is_background_type(type)) && + !(file_view.is_encrypted() && type == FileType::Ringtone)) { // TODO: send encrypted file to unencrypted chat return Status::Error(400, "Type of file mismatch"); }