Mark leave group messages as sent

// FREEBIE
pull/749/head
lilia 10 years ago
parent b1d3829651
commit d8803ee31f

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

Loading…
Cancel
Save