diff --git a/js/models/conversations.js b/js/models/conversations.js index e8cc0247..519dcbf7 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -62,19 +62,6 @@ message.save().then(this.trigger.bind(this,'newmessage', message)); }, - addMemberLeft: function(source) { - var timestamp = Date.now(); - var message = new Whisper.Message({ - conversationId : this.id, - source : source, - type : 'incoming', - sent_at : timestamp, - received_at : timestamp, - group_update : {left: source} - }); - message.save().then(this.trigger.bind(this,'newmessage', message)); - }, - onReadMessage: function(message) { if (this.messageCollection.get(message.id)) { this.messageCollection.get(message.id).fetch(); diff --git a/js/models/messages.js b/js/models/messages.js index 58514110..7dc939e4 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -201,39 +201,24 @@ this.sendSyncMessage(); }.bind(this)).catch(function(result) { var now = Date.now(); - var errors; - var conversation = this.getConversation(); this.trigger('done'); if (result.dataMessage) { this.set({dataMessage: result.dataMessage}); } if (result instanceof Error) { - errors = [result]; - this.saveErrors(errors); + this.saveErrors(result); if (result.name === 'SignedPreKeyRotationError') { getAccountManager().rotateSignedPreKey(); } } else { - errors = result.errors; - this.saveErrors(errors); + this.saveErrors(result.errors); if (result.successfulNumbers.length > 0) { this.set({sent: true, expirationStartTimestamp: now}); this.sendSyncMessage(); } } - if (conversation.get('type') === 'group') { - errors.forEach(function(e) { - if (e.name === 'UnregisteredUserError') { - textsecure.storage.groups.removeNumber(conversation.id, e.number); - conversation.addMemberLeft(e.number); - conversation.set({ - members: _.without(conversation.get('members'), e.number) - }); - } - }); - } }.bind(this)); },