Move makeAttachmentPointer
Clean up unnecessary pre-declaration of `var makeAttachmentPointer`.
This commit is contained in:
@@ -39769,7 +39769,20 @@ window.textsecure.messaging = function() {
|
||||
});
|
||||
}
|
||||
|
||||
var makeAttachmentPointer;
|
||||
function makeAttachmentPointer(attachment) {
|
||||
var proto = new textsecure.protobuf.AttachmentPointer();
|
||||
proto.key = textsecure.crypto.getRandomBytes(64);
|
||||
|
||||
var iv = textsecure.crypto.getRandomBytes(16);
|
||||
return textsecure.crypto.encryptAttachment(attachment.data, proto.key, iv).then(function(encryptedBin) {
|
||||
return TextSecureServer.putAttachment(encryptedBin).then(function(id) {
|
||||
proto.id = id;
|
||||
proto.contentType = attachment.contentType;
|
||||
return proto;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var refreshGroup = function(number, groupId, devicesForNumber) {
|
||||
groupId = getString(groupId);
|
||||
|
||||
@@ -39951,20 +39964,6 @@ window.textsecure.messaging = function() {
|
||||
getDevicesAndSendToNumber(numbers[i]);
|
||||
}
|
||||
|
||||
makeAttachmentPointer = function(attachment) {
|
||||
var proto = new textsecure.protobuf.AttachmentPointer();
|
||||
proto.key = textsecure.crypto.getRandomBytes(64);
|
||||
|
||||
var iv = textsecure.crypto.getRandomBytes(16);
|
||||
return textsecure.crypto.encryptAttachment(attachment.data, proto.key, iv).then(function(encryptedBin) {
|
||||
return TextSecureServer.putAttachment(encryptedBin).then(function(id) {
|
||||
proto.id = id;
|
||||
proto.contentType = attachment.contentType;
|
||||
return proto;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var sendIndividualProto = function(number, proto, timestamp) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
sendMessageProto(timestamp, [number], proto, function(res) {
|
||||
|
Reference in New Issue
Block a user