Fix wrong contact in some timer updates

Mistakenly showed 'You' for timer updates inferred from incoming
messages.
This commit is contained in:
lilia 2016-10-05 22:31:27 +09:00
parent 73e69fe5eb
commit 4ee2652367
2 changed files with 12 additions and 1 deletions

View file

@ -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()) {

View file

@ -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() {