Mark leave group messages as sent

// FREEBIE
This commit is contained in:
lilia 2015-09-18 13:39:22 -07:00
parent b1d3829651
commit d8803ee31f

View file

@ -147,14 +147,17 @@
leaveGroup: function() {
var now = Date.now();
if (this.get('type') === 'group') {
textsecure.messaging.leaveGroup(this.id);
this.messageCollection.add({
var message = this.messageCollection.add({
group_update: { left: 'You' },
conversationId : this.id,
type : 'outgoing',
sent_at : now,
received_at : now
}).save();
});
message.save();
textsecure.messaging.leaveGroup(this.id).then(function() {
message.save({sent: true});
});
}
},