Include outgoing control messages in message history
So you know it worked.
This commit is contained in:
parent
f067bb9954
commit
ce36c36bd0
2 changed files with 28 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue