Skip to content

Commit

Permalink
Populate attachment file size
Browse files Browse the repository at this point in the history
// FREEBIE
  • Loading branch information
liliakai committed Apr 18, 2017
1 parent fc514aa commit 27a1c9f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions js/libtextsecure.js
Expand Up @@ -38538,6 +38538,9 @@ MessageReceiver.prototype.extend({
handleAttachment: function(attachment) {
attachment.id = attachment.id.toString();
attachment.key = attachment.key.toArrayBuffer();
if (attachment.size) {
attachment.size = attachment.size.toNumber();
}
if (attachment.digest) {
attachment.digest = attachment.digest.toArrayBuffer();
}
Expand Down Expand Up @@ -39052,6 +39055,9 @@ MessageSender.prototype = {
if (attachment.fileName) {
proto.fileName = attachment.fileName;
}
if (attachment.size) {
proto.size = attachment.size;
}
return proto;
});
}.bind(this));
Expand Down
3 changes: 2 additions & 1 deletion js/views/file_input_view.js
Expand Up @@ -229,7 +229,8 @@
resolve({
data: e.target.result,
contentType: file.type,
fileName: file.name
fileName: file.name,
size: file.size
});
};
FR.onerror = reject;
Expand Down
3 changes: 3 additions & 0 deletions libtextsecure/message_receiver.js
Expand Up @@ -344,6 +344,9 @@ MessageReceiver.prototype.extend({
handleAttachment: function(attachment) {
attachment.id = attachment.id.toString();
attachment.key = attachment.key.toArrayBuffer();
if (attachment.size) {
attachment.size = attachment.size.toNumber();
}
if (attachment.digest) {
attachment.digest = attachment.digest.toArrayBuffer();
}
Expand Down
3 changes: 3 additions & 0 deletions libtextsecure/sendmessage.js
Expand Up @@ -127,6 +127,9 @@ MessageSender.prototype = {
if (attachment.fileName) {
proto.fileName = attachment.fileName;
}
if (attachment.size) {
proto.size = attachment.size;
}
return proto;
});
}.bind(this));
Expand Down

0 comments on commit 27a1c9f

Please sign in to comment.