Increase maximum photo size for upload by hash.

GitOrigin-RevId: b7dbcaf4710d04b03fc8eaf1d0c1c51ad5224829
This commit is contained in:
levlam 2020-05-07 18:37:49 +03:00
parent e941622e32
commit f2cb3afaef

View File

@ -3031,7 +3031,7 @@ Result<FileId> FileManager::get_input_file_id(FileType type, const tl_object_ptr
string hash;
if (false && new_type == FileType::Photo) {
auto r_stat = stat(path);
if (r_stat.is_ok() && r_stat.ok().size_ > 0 && r_stat.ok().size_ < 1000000) {
if (r_stat.is_ok() && r_stat.ok().size_ > 0 && r_stat.ok().size_ < 5000000) {
auto r_file_content = read_file_str(path, r_stat.ok().size_);
if (r_file_content.is_ok()) {
hash = sha256(r_file_content.ok());