Skip to content

Commit

Permalink
Fix no delivery receipts on close session messages
Browse files Browse the repository at this point in the history
// FREEBIE
  • Loading branch information
liliakai committed Dec 11, 2015
1 parent adf919e commit bc576e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions js/libtextsecure.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion js/models/conversations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

},
Expand Down
4 changes: 2 additions & 2 deletions libtextsecure/sendmessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bc576e1

Please sign in to comment.