From 800e5ab7031034e9bd548a2014c91c881d670a95 Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 29 Oct 2014 23:18:28 -0700 Subject: [PATCH] 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 --- js/sendmessage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/sendmessage.js b/js/sendmessage.js index 33cb88ff5..5a1b8c331 100644 --- a/js/sendmessage.js +++ b/js/sendmessage.js @@ -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; });