1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-09-25 22:29:45 +00:00

Add support for multiple files types

This commit is contained in:
2021-03-06 09:35:36 +01:00
parent dc93d58d6b
commit afcce8463f
11 changed files with 377 additions and 35 deletions

View File

@@ -166,4 +166,29 @@ pub const MIN_SUPPORTED_MOBILE_VERSION: &str = "1.1.1";
/// Minimum message length
pub const MIN_CONVERSATION_MESSAGE_LENGTH: usize = 1;
pub const MAX_CONVERSATION_MESSAGE_LENGTH: usize = 16000;
pub const MAX_CONVERSATION_MESSAGE_LENGTH: usize = 16000;
/// Allowed files type in conversations
pub const ALLOWED_CONVERSATION_FILES_TYPES: [&str; 17] = [
"image/png", "image/jpeg", "image/gif", "image/bmp",
"application/pdf",
"audio/mpeg",
"video/mp4",
"application/zip",
// MS Office docs
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
// Open Office docs
"application/vnd.oasis.opendocument.text",
"application/vnd.oasis.opendocument.presentation",
"application/vnd.oasis.opendocument.spreadsheet",
// Source code docs (UTF-8 encoded)
"text/x-csrc", "text/plain", "text/x-c++src"
];
/// File maximum size in conversations (10 Mb)
pub const CONVERSATION_FILES_MAX_SIZE: usize = 10 * 1024 * 1024;