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) {
|
receiveMessage: function(decrypted) {
|
||||||
var conversation = this;
|
var conversation = this;
|
||||||
var timestamp = decrypted.pushMessage.timestamp.toNumber();
|
var timestamp = decrypted.pushMessage.timestamp.toNumber();
|
||||||
|
|
|
@ -52,12 +52,24 @@
|
||||||
'submit .send': 'sendMessage',
|
'submit .send': 'sendMessage',
|
||||||
'close': 'remove',
|
'close': 'remove',
|
||||||
'click .destroy': 'destroyMessages',
|
'click .destroy': 'destroyMessages',
|
||||||
|
'click .end-session': 'endSession',
|
||||||
|
'click .leave-group': 'leaveGroup',
|
||||||
'click .new-group-update': 'newGroupUpdate',
|
'click .new-group-update': 'newGroupUpdate',
|
||||||
'click .settings-btn': 'toggleSettings',
|
'click .settings-btn': 'toggleSettings',
|
||||||
'click .go-back': 'toggleSettings',
|
'click .go-back': 'toggleSettings',
|
||||||
'click .hamburger': 'toggleMenu'
|
'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() {
|
toggleMenu: function() {
|
||||||
this.$el.find('.menu-list').toggle();
|
this.$el.find('.menu-list').toggle();
|
||||||
},
|
},
|
||||||
|
@ -80,6 +92,7 @@
|
||||||
this.remove();
|
this.remove();
|
||||||
this.model.trigger('destroy');
|
this.model.trigger('destroy');
|
||||||
}
|
}
|
||||||
|
this.$el.find('.menu-list').hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
sendMessage: function(e) {
|
sendMessage: function(e) {
|
||||||
|
|
Loading…
Reference in a new issue