Fix wrong contact in some timer updates

Mistakenly showed 'You' for timer updates inferred from incoming
messages.
pull/749/head
lilia 9 years ago
parent 73e69fe5eb
commit 4ee2652367

@ -120,6 +120,17 @@
id: this.get('conversationId')
});
},
getExpirationTimerUpdateSource: function() {
if (this.isExpirationTimerUpdate()) {
var conversationId = this.get('expirationTimerUpdate').source;
var c = ConversationController.get(conversationId);
if (!c) {
c = ConversationController.create({id: conversationId, type: 'private'});
c.fetch();
}
return c;
}
},
getContact: function() {
var conversationId = this.get('source');
if (!this.isIncoming()) {

@ -51,7 +51,7 @@
return this.model.id;
},
initialize: function() {
this.conversation = this.model.getContact();
this.conversation = this.model.getExpirationTimerUpdateSource();
this.listenTo(this.conversation, 'change', this.render);
},
render_attributes: function() {

Loading…
Cancel
Save