Fix wrong contact in some timer updates
Mistakenly showed 'You' for timer updates inferred from incoming messages.
This commit is contained in:
parent
73e69fe5eb
commit
4ee2652367
2 changed files with 12 additions and 1 deletions
|
@ -120,6 +120,17 @@
|
||||||
id: this.get('conversationId')
|
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() {
|
getContact: function() {
|
||||||
var conversationId = this.get('source');
|
var conversationId = this.get('source');
|
||||||
if (!this.isIncoming()) {
|
if (!this.isIncoming()) {
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
return this.model.id;
|
return this.model.id;
|
||||||
},
|
},
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.conversation = this.model.getContact();
|
this.conversation = this.model.getExpirationTimerUpdateSource();
|
||||||
this.listenTo(this.conversation, 'change', this.render);
|
this.listenTo(this.conversation, 'change', this.render);
|
||||||
},
|
},
|
||||||
render_attributes: function() {
|
render_attributes: function() {
|
||||||
|
|
Loading…
Reference in a new issue