diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 78206dc671..1580c63ab8 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -37494,11 +37494,11 @@ MessageSender.prototype = { }.bind(this)); }, - closeSession: function(number) { + closeSession: function(number, timestamp) { var proto = new textsecure.protobuf.DataMessage(); proto.body = "TERMINATE"; proto.flags = textsecure.protobuf.DataMessage.Flags.END_SESSION; - return this.sendIndividualProto(number, proto, Date.now()).then(function(res) { + return this.sendIndividualProto(number, proto, timestamp).then(function(res) { return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devices) { return Promise.all(devices.map(function(device) { return textsecure.protocol_wrapper.closeOpenSessionForDevice(device.encodedNumber); diff --git a/js/models/conversations.js b/js/models/conversations.js index aa6fdeccdc..57fbb833a4 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -133,7 +133,7 @@ received_at : now, flags : textsecure.protobuf.DataMessage.Flags.END_SESSION }); - message.send(textsecure.messaging.closeSession(this.id)); + message.send(textsecure.messaging.closeSession(this.id, now)); } }, diff --git a/libtextsecure/sendmessage.js b/libtextsecure/sendmessage.js index 22a3c6b14b..eaee8a404f 100644 --- a/libtextsecure/sendmessage.js +++ b/libtextsecure/sendmessage.js @@ -152,11 +152,11 @@ MessageSender.prototype = { }.bind(this)); }, - closeSession: function(number) { + closeSession: function(number, timestamp) { var proto = new textsecure.protobuf.DataMessage(); proto.body = "TERMINATE"; proto.flags = textsecure.protobuf.DataMessage.Flags.END_SESSION; - return this.sendIndividualProto(number, proto, Date.now()).then(function(res) { + return this.sendIndividualProto(number, proto, timestamp).then(function(res) { return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devices) { return Promise.all(devices.map(function(device) { return textsecure.protocol_wrapper.closeOpenSessionForDevice(device.encodedNumber);