From bcada5de4b5d6b1747d558d5c35e84137f3c3972 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Aug 2017 10:01:41 +0200 Subject: [PATCH] feat(Chat): disable file size limitation (close #66) --- src/components/chat/ChatModel.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/chat/ChatModel.cpp b/src/components/chat/ChatModel.cpp index 97d229dad..8e8d17efa 100644 --- a/src/components/chat/ChatModel.cpp +++ b/src/components/chat/ChatModel.cpp @@ -41,7 +41,10 @@ #define THUMBNAIL_IMAGE_FILE_HEIGHT 100 #define THUMBNAIL_IMAGE_FILE_WIDTH 100 -// In Bytes. +// Not enabled by default. +#define LIMIT_FILE_SIZE 0 + +// In Bytes. (500) #define FILE_SIZE_LIMIT 524288000 using namespace std; @@ -387,10 +390,13 @@ void ChatModel::sendFileMessage (const QString &path) { return; qint64 fileSize = file.size(); - if (fileSize > FILE_SIZE_LIMIT) { - qWarning() << QStringLiteral("Unable to send file. (Size limit=%1)").arg(FILE_SIZE_LIMIT); - return; - } + + #if LIMIT_FILE_SIZE + if (fileSize > FILE_SIZE_LIMIT) { + qWarning() << QStringLiteral("Unable to send file. (Size limit=%1)").arg(FILE_SIZE_LIMIT); + return; + } + #endif shared_ptr content = CoreManager::getInstance()->getCore()->createContent(); {