Increase maximum photo size for upload by hash.
GitOrigin-RevId: b7dbcaf4710d04b03fc8eaf1d0c1c51ad5224829
This commit is contained in:
parent
e941622e32
commit
f2cb3afaef
@ -3031,7 +3031,7 @@ Result<FileId> FileManager::get_input_file_id(FileType type, const tl_object_ptr
|
|||||||
string hash;
|
string hash;
|
||||||
if (false && new_type == FileType::Photo) {
|
if (false && new_type == FileType::Photo) {
|
||||||
auto r_stat = stat(path);
|
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_);
|
auto r_file_content = read_file_str(path, r_stat.ok().size_);
|
||||||
if (r_file_content.is_ok()) {
|
if (r_file_content.is_ok()) {
|
||||||
hash = sha256(r_file_content.ok());
|
hash = sha256(r_file_content.ok());
|
||||||
|
Reference in New Issue
Block a user