Give libtextsecure its own components (with way fewer deps)
This commit is contained in:
parent
899d756469
commit
07899557dc
7 changed files with 18237 additions and 11 deletions
|
@ -10,6 +10,11 @@ module.exports = function(grunt) {
|
||||||
components.push('components/' + bower.concat.app[i] + '/**/*.js');
|
components.push('components/' + bower.concat.app[i] + '/**/*.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var libcomponents = [];
|
||||||
|
for (i in bower.concat.lib) {
|
||||||
|
libcomponents.push('components/' + bower.concat.lib[i] + '/**/*.js');
|
||||||
|
}
|
||||||
|
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
pkg: grunt.file.readJSON('package.json'),
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
concat: {
|
concat: {
|
||||||
|
@ -17,6 +22,10 @@ module.exports = function(grunt) {
|
||||||
src: components,
|
src: components,
|
||||||
dest: 'js/components.js',
|
dest: 'js/components.js',
|
||||||
},
|
},
|
||||||
|
libcomponents: {
|
||||||
|
src: libcomponents,
|
||||||
|
dest: 'libtextsecure/components.js',
|
||||||
|
},
|
||||||
curve25519: {
|
curve25519: {
|
||||||
src: [
|
src: [
|
||||||
'build/curve25519_compiled.js',
|
'build/curve25519_compiled.js',
|
||||||
|
|
|
@ -99,6 +99,13 @@
|
||||||
"libphonenumber-api",
|
"libphonenumber-api",
|
||||||
"momentjs",
|
"momentjs",
|
||||||
"native-client"
|
"native-client"
|
||||||
|
],
|
||||||
|
"lib": [
|
||||||
|
"jquery",
|
||||||
|
"long",
|
||||||
|
"bytebuffer",
|
||||||
|
"protobuf",
|
||||||
|
"native-client"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2524,7 +2524,8 @@ window.textsecure.messaging = function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_.each(numbers, function(number) {
|
for (var i in numbers) {
|
||||||
|
var number = numbers[i];
|
||||||
var devicesForNumber = textsecure.storage.devices.getDeviceObjectsForNumber(number);
|
var devicesForNumber = textsecure.storage.devices.getDeviceObjectsForNumber(number);
|
||||||
|
|
||||||
var promises = [];
|
var promises = [];
|
||||||
|
@ -2544,7 +2545,7 @@ window.textsecure.messaging = function() {
|
||||||
} else
|
} else
|
||||||
doSendMessage(number, devicesForNumber, true);
|
doSendMessage(number, devicesForNumber, true);
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
makeAttachmentPointer = function(attachment) {
|
makeAttachmentPointer = function(attachment) {
|
||||||
|
|
18210
libtextsecure/components.js
Normal file
18210
libtextsecure/components.js
Normal file
File diff suppressed because it is too large
Load diff
|
@ -203,7 +203,8 @@ window.textsecure.messaging = function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_.each(numbers, function(number) {
|
for (var i in numbers) {
|
||||||
|
var number = numbers[i];
|
||||||
var devicesForNumber = textsecure.storage.devices.getDeviceObjectsForNumber(number);
|
var devicesForNumber = textsecure.storage.devices.getDeviceObjectsForNumber(number);
|
||||||
|
|
||||||
var promises = [];
|
var promises = [];
|
||||||
|
@ -223,7 +224,7 @@ window.textsecure.messaging = function() {
|
||||||
} else
|
} else
|
||||||
doSendMessage(number, devicesForNumber, true);
|
doSendMessage(number, devicesForNumber, true);
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
makeAttachmentPointer = function(attachment) {
|
makeAttachmentPointer = function(attachment) {
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<script type="text/javascript" src="test.js"></script>
|
<script type="text/javascript" src="test.js"></script>
|
||||||
<script type="text/javascript" src="blanket_mocha.js"></script>
|
<script type="text/javascript" src="blanket_mocha.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="../../js/components.js"></script>
|
<script type="text/javascript" src="../components.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="../../js/curve25519_compiled.js"></script>
|
<script type="text/javascript" src="../../js/curve25519_compiled.js"></script>
|
||||||
<script type="text/javascript" src="../../js/nativeclient.js"></script>
|
<script type="text/javascript" src="../../js/nativeclient.js"></script>
|
||||||
|
@ -52,8 +52,6 @@
|
||||||
<script type="text/javascript" src="../protocol.js" data-cover></script>
|
<script type="text/javascript" src="../protocol.js" data-cover></script>
|
||||||
<script type="text/javascript" src="../sendmessage.js" data-cover></script>
|
<script type="text/javascript" src="../sendmessage.js" data-cover></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="../../js/chromium.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="fake_api.js"></script>
|
<script type="text/javascript" src="fake_api.js"></script>
|
||||||
<script type="text/javascript" src="testvectors.js"></script>
|
<script type="text/javascript" src="testvectors.js"></script>
|
||||||
<script type="text/javascript" src="curve25519_test.js"></script>
|
<script type="text/javascript" src="curve25519_test.js"></script>
|
||||||
|
|
|
@ -219,14 +219,14 @@ describe('Protocol', function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
describe("test vectors", function() {
|
describe("test vectors", function() {
|
||||||
_.each(axolotlTestVectors, function(t, i) {
|
for (var i in axolotlTestVectors) {
|
||||||
it(t.name, function(done) {
|
it(axolotlTestVectors[i].name, function(done) {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
return runAxolotlTest(t.vectors).then(function(res) {
|
return runAxolotlTest(axolotlTestVectors[i].vectors).then(function(res) {
|
||||||
assert(res);
|
assert(res);
|
||||||
}).then(done).catch(done);
|
}).then(done).catch(done);
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue