Include outgoing control messages in message history

So you know it worked.
pull/749/head
lilia 10 years ago
parent f067bb9954
commit ce36c36bd0

@ -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();
}
},

@ -127,6 +127,18 @@
group.save().then(function() {
this.trigger('open', {modelId: groupId});
}.bind(this));
var now = Date.now();
group.messageCollection.add({
conversationId : this.id,
type : 'outgoing',
sent_at : now,
received_at : now,
group_update : {
name: group.get('name'),
avatar: group.get('avatar'),
joined: group.get('members')
}
}).save();
textsecure.messaging.updateGroup(
group.id,
group.get('name'),

Loading…
Cancel
Save