Set messageKeysLimit to unlimited if communicating with our devices (#1348)
Set messageKeysLimit to unlimited if communicating with our devices FREEBIE
This commit is contained in:
parent
7e0bd82bd3
commit
e223db56d9
4 changed files with 88 additions and 14 deletions
|
@ -137,7 +137,17 @@ OutgoingMessage.prototype = {
|
|||
|
||||
return Promise.all(deviceIds.map(function(deviceId) {
|
||||
var address = new libsignal.SignalProtocolAddress(number, deviceId);
|
||||
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
|
||||
|
||||
var ourNumber = textsecure.storage.user.getNumber();
|
||||
var number = address.toString().split('.')[0];
|
||||
var options = {};
|
||||
|
||||
// No limit on message keys if we're communicating with our other devices
|
||||
if (ourNumber === number) {
|
||||
options.messageKeysLimit = false;
|
||||
}
|
||||
|
||||
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address, options);
|
||||
ciphers[address.getDeviceId()] = sessionCipher;
|
||||
return sessionCipher.encrypt(plaintext).then(function(ciphertext) {
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue