mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-30 10:29:24 +00:00
fix(app): fix implicit conversions and limit file size in chat
This commit is contained in:
parent
ac0f9722fc
commit
69d3e7b522
3 changed files with 15 additions and 5 deletions
|
|
@ -76,8 +76,8 @@ QOpenGLFramebufferObject *CameraRenderer::createFramebufferObject (const QSize &
|
|||
// It's not the same thread as render.
|
||||
coreManager->lockVideoRender();
|
||||
|
||||
mContextInfo->width = size.width();
|
||||
mContextInfo->height = size.height();
|
||||
mContextInfo->width = static_cast<GLuint>(size.width());
|
||||
mContextInfo->height = static_cast<GLuint>(size.height());
|
||||
mContextInfo->functions = MSFunctions::getInstance()->getFunctions();
|
||||
mUpdateContextInfo = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ QOpenGLFramebufferObject *CameraPreviewRenderer::createFramebufferObject (const
|
|||
// It's not the same thread as render.
|
||||
coreManager->lockVideoRender();
|
||||
|
||||
mContextInfo->width = size.width();
|
||||
mContextInfo->height = size.height();
|
||||
mContextInfo->width = static_cast<GLuint>(size.width());
|
||||
mContextInfo->height = static_cast<GLuint>(size.height());
|
||||
mContextInfo->functions = MSFunctions::getInstance()->getFunctions();
|
||||
mUpdateContextInfo = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@
|
|||
#define THUMBNAIL_IMAGE_FILE_HEIGHT 100
|
||||
#define THUMBNAIL_IMAGE_FILE_WIDTH 100
|
||||
|
||||
// In Bytes.
|
||||
#define FILE_SIZE_LIMIT 524288000
|
||||
|
||||
using namespace std;
|
||||
|
||||
// =============================================================================
|
||||
|
|
@ -367,10 +370,17 @@ void ChatModel::sendFileMessage (const QString &path) {
|
|||
if (!file.exists())
|
||||
return;
|
||||
|
||||
qint64 fileSize = file.size();
|
||||
if (fileSize > FILE_SIZE_LIMIT) {
|
||||
qWarning() << QStringLiteral("Unable to send file. (Size limit=%1)").arg(FILE_SIZE_LIMIT);
|
||||
return;
|
||||
}
|
||||
|
||||
shared_ptr<linphone::Content> content = CoreManager::getInstance()->getCore()->createContent();
|
||||
content->setType("application");
|
||||
content->setSubtype("octet-stream");
|
||||
content->setSize(file.size());
|
||||
|
||||
content->setSize(static_cast<size_t>(fileSize));
|
||||
content->setName(::Utils::qStringToLinphoneString(QFileInfo(file).fileName()));
|
||||
|
||||
shared_ptr<linphone::ChatMessage> message = mChatRoom->createFileTransferMessage(content);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue