parent
85b4643e9b
commit
488f25635d
2 changed files with 26 additions and 0 deletions
|
@ -106,6 +106,19 @@
|
|||
});
|
||||
},
|
||||
|
||||
endSession: function() {
|
||||
if (this.get('type') === 'private') {
|
||||
textsecure.messaging.closeSession(this.id);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
leaveGroup: function() {
|
||||
if (this.get('type') === 'group') {
|
||||
textsecure.messaging.leaveGroup(this.id);
|
||||
}
|
||||
},
|
||||
|
||||
receiveMessage: function(decrypted) {
|
||||
var conversation = this;
|
||||
var timestamp = decrypted.pushMessage.timestamp.toNumber();
|
||||
|
|
|
@ -52,12 +52,24 @@
|
|||
'submit .send': 'sendMessage',
|
||||
'close': 'remove',
|
||||
'click .destroy': 'destroyMessages',
|
||||
'click .end-session': 'endSession',
|
||||
'click .leave-group': 'leaveGroup',
|
||||
'click .new-group-update': 'newGroupUpdate',
|
||||
'click .settings-btn': 'toggleSettings',
|
||||
'click .go-back': 'toggleSettings',
|
||||
'click .hamburger': 'toggleMenu'
|
||||
},
|
||||
|
||||
endSession: function() {
|
||||
this.model.endSession();
|
||||
this.$el.find('.menu-list').hide();
|
||||
},
|
||||
|
||||
leaveGroup: function() {
|
||||
this.model.leaveGroup();
|
||||
this.$el.find('.menu-list').hide();
|
||||
},
|
||||
|
||||
toggleMenu: function() {
|
||||
this.$el.find('.menu-list').toggle();
|
||||
},
|
||||
|
@ -80,6 +92,7 @@
|
|||
this.remove();
|
||||
this.model.trigger('destroy');
|
||||
}
|
||||
this.$el.find('.menu-list').hide();
|
||||
},
|
||||
|
||||
sendMessage: function(e) {
|
||||
|
|
Loading…
Reference in a new issue