Frontend for timer updates and timer indicator
This commit is contained in:
parent
448835e4d5
commit
2b2c6ab040
10 changed files with 242 additions and 26 deletions
|
@ -71,7 +71,6 @@
|
|||
if (this.isIncoming() && this.hasErrors()) {
|
||||
return i18n('incomingError');
|
||||
}
|
||||
|
||||
return this.get('body');
|
||||
},
|
||||
getNotificationText: function() {
|
||||
|
@ -126,15 +125,6 @@
|
|||
}
|
||||
return c;
|
||||
},
|
||||
getModelForExpirationTimerUpdate: function() {
|
||||
var id = this.get('timerUpdate').source;
|
||||
var c = ConversationController.get(id);
|
||||
if (!c) {
|
||||
c = ConversationController.create({ id: id, type: 'private' });
|
||||
c.fetch();
|
||||
}
|
||||
return c;
|
||||
},
|
||||
isOutgoing: function() {
|
||||
return this.get('type') === 'outgoing';
|
||||
},
|
||||
|
@ -364,9 +354,18 @@
|
|||
flags : dataMessage.flags,
|
||||
errors : []
|
||||
});
|
||||
|
||||
if (dataMessage.expireTimer) {
|
||||
if (message.isExpirationTimerUpdate()) {
|
||||
message.set({
|
||||
expirationTimerUpdate: {
|
||||
source : source,
|
||||
expireTimer : dataMessage.expireTimer
|
||||
}
|
||||
});
|
||||
conversation.set({expireTimer: dataMessage.expireTimer});
|
||||
} else if (dataMessage.expireTimer) {
|
||||
message.set({expireTimer: dataMessage.expireTimer});
|
||||
// todo: insert an update if needed
|
||||
conversation.set({expireTimer: dataMessage.expireTimer});
|
||||
}
|
||||
|
||||
var conversation_timestamp = conversation.get('timestamp');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue