Pass protobuf attachment ids as strings

Latest protobuf.js requires that we pass in the sign value when making
longs from strings, ex: dcodeIO.Long.fromString(id, true);

However, it does the string->long conversion automatically if its given
a string for a fixed64 field, so we can pass our string ids right in!
ftw
This commit is contained in:
lilia 2014-10-29 23:18:28 -07:00
parent 73f4f64351
commit 800e5ab703

View file

@ -200,7 +200,7 @@ window.textsecure.messaging = function() {
var iv = textsecure.crypto.getRandomBytes(16);
return textsecure.crypto.encryptAttachment(attachment.data, proto.key, iv).then(function(encryptedBin) {
return textsecure.api.putAttachment(encryptedBin).then(function(id) {
proto.id = dcodeIO.Long.fromString(id);
proto.id = id;
proto.contentType = attachment.contentType;
return proto;
});