From dec582e9b7196a4ce60a23fd2e49d1e435256fe4 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 27 Apr 2021 19:05:27 +0200 Subject: [PATCH] Add support for QuickTime videos --- src/api_data/server_config.rs | 2 +- src/constants.rs | 3 ++- src/controllers/conversations_controller.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api_data/server_config.rs b/src/api_data/server_config.rs index a2116c0..42c3331 100644 --- a/src/api_data/server_config.rs +++ b/src/api_data/server_config.rs @@ -42,7 +42,7 @@ struct ConversationsPolicy { max_conversation_name_len: usize, min_message_len: usize, max_message_len: usize, - allowed_files_type: [&'static str; 17], + allowed_files_type: [&'static str; 18], files_max_size: usize, writing_event_interval: u64, writing_event_lifetime: u64, diff --git a/src/constants.rs b/src/constants.rs index 64abf0b..d521872 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -184,11 +184,12 @@ pub mod conversations { pub const MAX_CONVERSATION_MESSAGE_LENGTH: usize = 16000; /// Allowed files type in conversations - pub const ALLOWED_CONVERSATION_FILES_TYPES: [&str; 17] = [ + pub const ALLOWED_CONVERSATION_FILES_TYPES: [&str; 18] = [ "image/png", "image/jpeg", "image/gif", "image/bmp", "application/pdf", "audio/mpeg", "video/mp4", + "video/quicktime", "application/zip", // MS Office docs diff --git a/src/controllers/conversations_controller.rs b/src/controllers/conversations_controller.rs index 8d4964c..edd375f 100644 --- a/src/controllers/conversations_controller.rs +++ b/src/controllers/conversations_controller.rs @@ -331,7 +331,7 @@ pub fn send_message(r: &mut HttpRequestHandler) -> RequestResult { } // MP4 - else if mime_type.eq("video/mp4") { + else if mime_type.eq("video/mp4") || mime_type.eq("video/quicktime") { path = r.save_post_mp4("file", "conversation")?; }