mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 21:06:31 +03:00
dc_tools: rustify interfaces of file-related functions
This commit is contained in:
@@ -1311,16 +1311,14 @@ unsafe fn build_body_file(
|
||||
/*******************************************************************************
|
||||
* Render
|
||||
******************************************************************************/
|
||||
#[allow(non_snake_case)]
|
||||
unsafe fn is_file_size_okay(msg: *const dc_msg_t) -> bool {
|
||||
let mut file_size_okay = true;
|
||||
let pathNfilename = (*msg).param.get(Param::File).unwrap_or_default().strdup();
|
||||
let bytes = dc_get_filebytes((*msg).context, pathNfilename);
|
||||
let path = (*msg).param.get(Param::File).unwrap_or_default();
|
||||
let bytes = dc_get_filebytes((*msg).context, &path);
|
||||
|
||||
if bytes > (49 * 1024 * 1024 / 4 * 3) {
|
||||
file_size_okay = false;
|
||||
}
|
||||
free(pathNfilename as *mut _);
|
||||
|
||||
file_size_okay
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user