Include outgoing control messages in message history

So you know it worked.
This commit is contained in:
lilia 2015-03-23 19:08:05 -07:00
parent f067bb9954
commit ce36c36bd0
2 changed files with 28 additions and 0 deletions

View file

@ -112,14 +112,30 @@
endSession: function() {
if (this.get('type') === 'private') {
var now = Date.now();
textsecure.messaging.closeSession(this.id);
this.messageCollection.add({
conversationId : this.id,
type : 'outgoing',
sent_at : now,
received_at : now,
flags : textsecure.protobuf.PushMessageContent.Flags.END_SESSION
}).save();
}
},
leaveGroup: function() {
var now = Date.now();
if (this.get('type') === 'group') {
textsecure.messaging.leaveGroup(this.id);
this.messageCollection.add({
group_update: { left: 'You' },
conversationId : this.id,
type : 'outgoing',
sent_at : now,
received_at : now
}).save();
}
},