Mark end session messages sent
This commit is contained in:
parent
c94c4bc7e0
commit
17a3025af2
1 changed files with 6 additions and 3 deletions
|
@ -127,14 +127,17 @@
|
||||||
endSession: function() {
|
endSession: function() {
|
||||||
if (this.get('type') === 'private') {
|
if (this.get('type') === 'private') {
|
||||||
var now = Date.now();
|
var now = Date.now();
|
||||||
textsecure.messaging.closeSession(this.id);
|
var message = this.messageCollection.add({
|
||||||
this.messageCollection.add({
|
|
||||||
conversationId : this.id,
|
conversationId : this.id,
|
||||||
type : 'outgoing',
|
type : 'outgoing',
|
||||||
sent_at : now,
|
sent_at : now,
|
||||||
received_at : now,
|
received_at : now,
|
||||||
flags : textsecure.protobuf.DataMessage.Flags.END_SESSION
|
flags : textsecure.protobuf.DataMessage.Flags.END_SESSION
|
||||||
}).save();
|
});
|
||||||
|
message.save();
|
||||||
|
textsecure.messaging.closeSession(this.id).then(function() {
|
||||||
|
message.save({sent: true});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue