Sync end session messages

// FREEBIE
This commit is contained in:
lilia 2016-02-03 18:18:42 -08:00 committed by Lilia
parent cfe0c77243
commit 4842ef6153
2 changed files with 22 additions and 18 deletions

View file

@ -39263,17 +39263,19 @@ MessageSender.prototype = {
proto.body = "TERMINATE";
proto.flags = textsecure.protobuf.DataMessage.Flags.END_SESSION;
return this.sendIndividualProto(number, proto, timestamp).then(function(res) {
return textsecure.storage.protocol.getDeviceIds(number).then(function(deviceIds) {
return Promise.all(deviceIds.map(function(deviceId) {
var address = new libsignal.SignalProtocolAddress(number, deviceId);
console.log('closing session for', address.toString());
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
return sessionCipher.closeOpenSessionForDevice();
})).then(function() {
return res;
return this.sendSyncMessage(proto.toArrayBuffer(), timestamp, number).then(function() {
return textsecure.storage.protocol.getDeviceIds(number).then(function(deviceIds) {
return Promise.all(deviceIds.map(function(deviceId) {
var address = new libsignal.SignalProtocolAddress(number, deviceId);
console.log('closing session for', address.toString());
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
return sessionCipher.closeOpenSessionForDevice();
})).then(function() {
return res;
});
});
});
});
}.bind(this));
},
sendMessageToGroup: function(groupId, messageText, attachments, timestamp, expireTimer) {

View file

@ -338,17 +338,19 @@ MessageSender.prototype = {
proto.body = "TERMINATE";
proto.flags = textsecure.protobuf.DataMessage.Flags.END_SESSION;
return this.sendIndividualProto(number, proto, timestamp).then(function(res) {
return textsecure.storage.protocol.getDeviceIds(number).then(function(deviceIds) {
return Promise.all(deviceIds.map(function(deviceId) {
var address = new libsignal.SignalProtocolAddress(number, deviceId);
console.log('closing session for', address.toString());
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
return sessionCipher.closeOpenSessionForDevice();
})).then(function() {
return res;
return this.sendSyncMessage(proto.toArrayBuffer(), timestamp, number).then(function() {
return textsecure.storage.protocol.getDeviceIds(number).then(function(deviceIds) {
return Promise.all(deviceIds.map(function(deviceId) {
var address = new libsignal.SignalProtocolAddress(number, deviceId);
console.log('closing session for', address.toString());
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
return sessionCipher.closeOpenSessionForDevice();
})).then(function() {
return res;
});
});
});
});
}.bind(this));
},
sendMessageToGroup: function(groupId, messageText, attachments, timestamp, expireTimer) {