Remove hasOpenSession from protocol_wrapper

// FREEBIE
This commit is contained in:
lilia 2016-05-01 15:29:37 -07:00
parent 0483fa2f97
commit 7939b6ae98
3 changed files with 6 additions and 14 deletions

View file

@ -35501,11 +35501,6 @@ Internal.SessionLock.queueJobForNumber = function queueJobForNumber(number, runJ
}, },
createIdentityKeyRecvSocket: function() { createIdentityKeyRecvSocket: function() {
return protocolInstance.createIdentityKeyRecvSocket(); return protocolInstance.createIdentityKeyRecvSocket();
},
hasOpenSession: function(encodedNumber) {
return queueJobForNumber(encodedNumber, function() {
return protocolInstance.hasOpenSession(encodedNumber);
});
} }
}; };
})(); })();
@ -35751,8 +35746,9 @@ Internal.SessionLock.queueJobForNumber = function queueJobForNumber(number, runJ
} }
var updateDevices = []; var updateDevices = [];
return Promise.all(deviceIds.map(function(deviceId) { return Promise.all(deviceIds.map(function(deviceId) {
var address = new libsignal.SignalProtocolAddress(number, deviceId).toString(); var address = new libsignal.SignalProtocolAddress(number, deviceId);
return textsecure.protocol_wrapper.hasOpenSession(address).then(function(hasSession) { var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
return sessionCipher.hasOpenSession().then(function(hasSession) {
if (!hasSession) { if (!hasSession) {
updateDevices.push(deviceId); updateDevices.push(deviceId);
} }

View file

@ -36,11 +36,6 @@
}, },
createIdentityKeyRecvSocket: function() { createIdentityKeyRecvSocket: function() {
return protocolInstance.createIdentityKeyRecvSocket(); return protocolInstance.createIdentityKeyRecvSocket();
},
hasOpenSession: function(encodedNumber) {
return queueJobForNumber(encodedNumber, function() {
return protocolInstance.hasOpenSession(encodedNumber);
});
} }
}; };
})(); })();

View file

@ -19,8 +19,9 @@
} }
var updateDevices = []; var updateDevices = [];
return Promise.all(deviceIds.map(function(deviceId) { return Promise.all(deviceIds.map(function(deviceId) {
var address = new libsignal.SignalProtocolAddress(number, deviceId).toString(); var address = new libsignal.SignalProtocolAddress(number, deviceId);
return textsecure.protocol_wrapper.hasOpenSession(address).then(function(hasSession) { var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
return sessionCipher.hasOpenSession().then(function(hasSession) {
if (!hasSession) { if (!hasSession) {
updateDevices.push(deviceId); updateDevices.push(deviceId);
} }