From 8aa2f771a711639f6b7e8404f1cc8343fbc6c8cc Mon Sep 17 00:00:00 2001 From: lilia Date: Sun, 7 May 2017 14:18:42 -0700 Subject: [PATCH] Remove self-listener in conversation model Since there is the only source/listener on this event, it can be called directly. // FREEBIE --- js/models/conversations.js | 1 - js/read_receipts.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/js/models/conversations.js b/js/models/conversations.js index 68e7e5d90..7305ad8bc 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -46,7 +46,6 @@ this.on('change:avatar', this.updateAvatarUrl); this.on('destroy', this.revokeAvatarUrl); - this.on('read', this.onReadMessage); this.fetchContacts().then(function() { this.contactCollection.each(function(contact) { textsecure.storage.protocol.on('keychange:' + contact.id, function() { diff --git a/js/read_receipts.js b/js/read_receipts.js index ca324da59..9e92aee79 100644 --- a/js/read_receipts.js +++ b/js/read_receipts.js @@ -35,7 +35,7 @@ if (conversation) { // notify frontend listeners - conversation.trigger('read', message); + conversation.onReadMessage(message); } }); } else {