|
|
@ -38913,6 +38913,14 @@ textsecure.processDecrypted = function(decrypted, source) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.textsecure.refreshPreKeys = function() {
|
|
|
|
|
|
|
|
return textsecure.api.getMyKeys().then(function(preKeyCount) {
|
|
|
|
|
|
|
|
if (preKeyCount < 10) {
|
|
|
|
|
|
|
|
generateKeys();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function createAccount(number, verificationCode, identityKeyPair, single_device) {
|
|
|
|
function createAccount(number, verificationCode, identityKeyPair, single_device) {
|
|
|
|
textsecure.storage.put('identityKey', identityKeyPair);
|
|
|
|
textsecure.storage.put('identityKey', identityKeyPair);
|
|
|
|
|
|
|
|
|
|
|
@ -39331,6 +39339,16 @@ window.textsecure.api = function () {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.getMyKeys = function(number, deviceId) {
|
|
|
|
|
|
|
|
return doAjax({
|
|
|
|
|
|
|
|
call : 'keys',
|
|
|
|
|
|
|
|
httpType : 'GET',
|
|
|
|
|
|
|
|
do_auth : true,
|
|
|
|
|
|
|
|
}).then(function(res) {
|
|
|
|
|
|
|
|
return parseInt(res.count);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
self.getKeysForNumber = function(number, deviceId) {
|
|
|
|
self.getKeysForNumber = function(number, deviceId) {
|
|
|
|
if (deviceId === undefined)
|
|
|
|
if (deviceId === undefined)
|
|
|
|
deviceId = "*";
|
|
|
|
deviceId = "*";
|
|
|
|