From 2bc65c2ab48fb57b87adeb31515799668fdb453c Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 16 Sep 2015 22:06:20 -0700 Subject: [PATCH] Let messages fetch references to senders The conversation's contactCollection only contains references to the current membership, and will not provide contact info for people who have left the group, causing their messages to render without numbers or avatars. // FREEBIE --- js/models/messages.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/models/messages.js b/js/models/messages.js index 4087aeaea0..b0cfbad95f 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -97,9 +97,16 @@ return this.imageUrl; }, getContact: function() { - if (this.collection) { - return this.collection.conversation.contactCollection.get(this.get('source')); + var conversationId = this.get('source'); + if (!this.isIncoming()) { + conversationId = textsecure.storage.user.getNumber(); } + var c = ConversationController.get(conversationId); + if (!c) { + c = ConversationController.create(conversationId); + c.fetch(); + } + return c; }, isOutgoing: function() { return this.get('type') === 'outgoing';