Mark leave group messages as sent
// FREEBIE
This commit is contained in:
parent
b1d3829651
commit
d8803ee31f
1 changed files with 6 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue