Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Datovka projects
mobile Datovka
Commits
458700b1
Commit
458700b1
authored
Oct 18, 2017
by
Martin Straka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the compute of total attachment size in send message
parent
4e77a0a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
src/net/isds_wrapper.cpp
src/net/isds_wrapper.cpp
+4
-0
src/worker/task_send_message.cpp
src/worker/task_send_message.cpp
+0
-1
No files found.
src/net/isds_wrapper.cpp
View file @
458700b1
...
...
@@ -480,6 +480,7 @@ void IsdsWrapper::sendMessage(const QString &userName,
msg
.
dmSenderIdent
=
dmSenderIdent
;
msg
.
dmAllowSubstDelivery
=
dmAllowSubstDelivery
;
msg
.
dmPersonalDelivery
=
dmPersonalDelivery
;
int
totalAttachmentSizeKBs
=
0
;
QList
<
Files
::
File
>
attachList
;
/* Load file contents from storage (path) to file structure */
...
...
@@ -487,6 +488,7 @@ void IsdsWrapper::sendMessage(const QString &userName,
Files
::
File
attach
;
QFileInfo
fi
(
file
);
attach
.
dmFileDescr
=
fi
.
fileName
();
totalAttachmentSizeKBs
+=
fi
.
size
()
/
1024
;
QFile
fin
(
file
);
if
(
!
fin
.
open
(
QIODevice
::
ReadOnly
))
{
continue
;
...
...
@@ -500,6 +502,8 @@ void IsdsWrapper::sendMessage(const QString &userName,
attachList
.
append
(
attach
);
}
msg
.
dmAttachmentSize
=
totalAttachmentSizeKBs
;
emit
statusBarTextChanged
(
tr
(
"%1: sending message"
).
arg
(
userName
),
true
,
true
);
...
...
src/worker/task_send_message.cpp
View file @
458700b1
...
...
@@ -108,7 +108,6 @@ enum TaskSendMessage::Result TaskSendMessage::sendMessage(
/* Fill missing message envelope data */
msg
.
dmID
=
msgID
;
msg
.
dmQTimestamp
=
""
;
msg
.
dmAttachmentSize
=
1
;
msg
.
dmMessageStatus
=
1
;
msg
.
_dmCustomData
=
""
;
msg
.
_dmReadLocally
=
true
;
...
...
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