Remove getRegistrationId and encryptMessageFor from protocol_wrapper

We can now use protocol classes like SessionCipher directly because it
supports per-device read/write serialization internally.

// FREEBIE
This commit is contained in:
lilia 2016-05-01 14:15:51 -07:00
parent 284cf5be3a
commit 843036f0ce
4 changed files with 18 additions and 44 deletions

View file

@ -40,13 +40,6 @@
return protocolInstance.closeOpenSessionForDevice(encodedNumber);
});
},
encryptMessageFor: function(deviceObject, pushMessageContent) {
return queueJobForNumber(deviceObject.encodedNumber, function() {
var address = libsignal.SignalProtocolAddress.fromString(deviceObject.encodedNumber);
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
return sessionCipher.encrypt(pushMessageContent);
});
},
startWorker: function() {
protocolInstance.startWorker('/js/libsignal-protocol-worker.js');
},
@ -61,11 +54,6 @@
return protocolInstance.hasOpenSession(encodedNumber);
});
},
getRegistrationId: function(encodedNumber) {
return queueJobForNumber(encodedNumber, function() {
return protocolInstance.getRegistrationId(encodedNumber);
});
},
handlePreKeyWhisperMessage: function(from, blob) {
console.log('prekey whisper message');
blob.mark();