Rename axolotlInstance

// FREEBIE
This commit is contained in:
lilia 2016-04-22 13:32:19 -07:00
parent 0fe3497d0e
commit ee3bc11e3c
2 changed files with 20 additions and 20 deletions

View file

@ -35297,7 +35297,7 @@ Internal.RecipientRecord = function() {
window.textsecure.storage = window.textsecure.storage || {};
textsecure.storage.axolotl = new SignalProtocolStore();
var axolotlInstance = axolotl.protocol(textsecure.storage.axolotl);
var protocolInstance = axolotl.protocol(textsecure.storage.axolotl);
/*
* jobQueue manages multiple queues indexed by device to serialize
@ -35320,36 +35320,36 @@ Internal.RecipientRecord = function() {
window.textsecure.protocol_wrapper = {
decryptWhisperMessage: function(fromAddress, blob) {
return queueJobForNumber(fromAddress, function() {
return axolotlInstance.decryptWhisperMessage(fromAddress, blob.toArrayBuffer());
return protocolInstance.decryptWhisperMessage(fromAddress, blob.toArrayBuffer());
});
},
closeOpenSessionForDevice: function(encodedNumber) {
return queueJobForNumber(encodedNumber, function() {
return axolotlInstance.closeOpenSessionForDevice(encodedNumber);
return protocolInstance.closeOpenSessionForDevice(encodedNumber);
});
},
encryptMessageFor: function(deviceObject, pushMessageContent) {
return queueJobForNumber(deviceObject.encodedNumber, function() {
return axolotlInstance.encryptMessageFor(deviceObject, pushMessageContent);
return protocolInstance.encryptMessageFor(deviceObject, pushMessageContent);
});
},
startWorker: function() {
axolotlInstance.startWorker('/js/libsignal-protocol-worker.js');
protocolInstance.startWorker('/js/libsignal-protocol-worker.js');
},
stopWorker: function() {
axolotlInstance.stopWorker();
protocolInstance.stopWorker();
},
createIdentityKeyRecvSocket: function() {
return axolotlInstance.createIdentityKeyRecvSocket();
return protocolInstance.createIdentityKeyRecvSocket();
},
hasOpenSession: function(encodedNumber) {
return queueJobForNumber(encodedNumber, function() {
return axolotlInstance.hasOpenSession(encodedNumber);
return protocolInstance.hasOpenSession(encodedNumber);
});
},
getRegistrationId: function(encodedNumber) {
return queueJobForNumber(encodedNumber, function() {
return axolotlInstance.getRegistrationId(encodedNumber);
return protocolInstance.getRegistrationId(encodedNumber);
});
},
handlePreKeyWhisperMessage: function(from, blob) {
@ -35361,7 +35361,7 @@ Internal.RecipientRecord = function() {
throw new Error("Incompatible version byte");
}
return queueJobForNumber(from, function() {
return axolotlInstance.handlePreKeyWhisperMessage(from, blob).catch(function(e) {
return protocolInstance.handlePreKeyWhisperMessage(from, blob).catch(function(e) {
if (e.message === 'Unknown identity key') {
blob.reset(); // restore the version byte.

View file

@ -7,7 +7,7 @@
window.textsecure.storage = window.textsecure.storage || {};
textsecure.storage.axolotl = new SignalProtocolStore();
var axolotlInstance = axolotl.protocol(textsecure.storage.axolotl);
var protocolInstance = axolotl.protocol(textsecure.storage.axolotl);
/*
* jobQueue manages multiple queues indexed by device to serialize
@ -30,36 +30,36 @@
window.textsecure.protocol_wrapper = {
decryptWhisperMessage: function(fromAddress, blob) {
return queueJobForNumber(fromAddress, function() {
return axolotlInstance.decryptWhisperMessage(fromAddress, blob.toArrayBuffer());
return protocolInstance.decryptWhisperMessage(fromAddress, blob.toArrayBuffer());
});
},
closeOpenSessionForDevice: function(encodedNumber) {
return queueJobForNumber(encodedNumber, function() {
return axolotlInstance.closeOpenSessionForDevice(encodedNumber);
return protocolInstance.closeOpenSessionForDevice(encodedNumber);
});
},
encryptMessageFor: function(deviceObject, pushMessageContent) {
return queueJobForNumber(deviceObject.encodedNumber, function() {
return axolotlInstance.encryptMessageFor(deviceObject, pushMessageContent);
return protocolInstance.encryptMessageFor(deviceObject, pushMessageContent);
});
},
startWorker: function() {
axolotlInstance.startWorker('/js/libsignal-protocol-worker.js');
protocolInstance.startWorker('/js/libsignal-protocol-worker.js');
},
stopWorker: function() {
axolotlInstance.stopWorker();
protocolInstance.stopWorker();
},
createIdentityKeyRecvSocket: function() {
return axolotlInstance.createIdentityKeyRecvSocket();
return protocolInstance.createIdentityKeyRecvSocket();
},
hasOpenSession: function(encodedNumber) {
return queueJobForNumber(encodedNumber, function() {
return axolotlInstance.hasOpenSession(encodedNumber);
return protocolInstance.hasOpenSession(encodedNumber);
});
},
getRegistrationId: function(encodedNumber) {
return queueJobForNumber(encodedNumber, function() {
return axolotlInstance.getRegistrationId(encodedNumber);
return protocolInstance.getRegistrationId(encodedNumber);
});
},
handlePreKeyWhisperMessage: function(from, blob) {
@ -71,7 +71,7 @@
throw new Error("Incompatible version byte");
}
return queueJobForNumber(from, function() {
return axolotlInstance.handlePreKeyWhisperMessage(from, blob).catch(function(e) {
return protocolInstance.handlePreKeyWhisperMessage(from, blob).catch(function(e) {
if (e.message === 'Unknown identity key') {
blob.reset(); // restore the version byte.