Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
69d3e7b5
Commit
69d3e7b5
authored
Apr 24, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(app): fix implicit conversions and limit file size in chat
parent
ac0f9722
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
Camera.cpp
linphone-desktop/src/components/camera/Camera.cpp
+2
-2
CameraPreview.cpp
linphone-desktop/src/components/camera/CameraPreview.cpp
+2
-2
ChatModel.cpp
linphone-desktop/src/components/chat/ChatModel.cpp
+11
-1
No files found.
linphone-desktop/src/components/camera/Camera.cpp
View file @
69d3e7b5
...
...
@@ -76,8 +76,8 @@ QOpenGLFramebufferObject *CameraRenderer::createFramebufferObject (const QSize &
// It's not the same thread as render.
coreManager
->
lockVideoRender
();
mContextInfo
->
width
=
s
ize
.
width
(
);
mContextInfo
->
height
=
s
ize
.
height
(
);
mContextInfo
->
width
=
s
tatic_cast
<
GLuint
>
(
size
.
width
()
);
mContextInfo
->
height
=
s
tatic_cast
<
GLuint
>
(
size
.
height
()
);
mContextInfo
->
functions
=
MSFunctions
::
getInstance
()
->
getFunctions
();
mUpdateContextInfo
=
true
;
...
...
linphone-desktop/src/components/camera/CameraPreview.cpp
View file @
69d3e7b5
...
...
@@ -71,8 +71,8 @@ QOpenGLFramebufferObject *CameraPreviewRenderer::createFramebufferObject (const
// It's not the same thread as render.
coreManager
->
lockVideoRender
();
mContextInfo
->
width
=
s
ize
.
width
(
);
mContextInfo
->
height
=
s
ize
.
height
(
);
mContextInfo
->
width
=
s
tatic_cast
<
GLuint
>
(
size
.
width
()
);
mContextInfo
->
height
=
s
tatic_cast
<
GLuint
>
(
size
.
height
()
);
mContextInfo
->
functions
=
MSFunctions
::
getInstance
()
->
getFunctions
();
mUpdateContextInfo
=
true
;
...
...
linphone-desktop/src/components/chat/ChatModel.cpp
View file @
69d3e7b5
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment