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
|
@ -166,20 +166,26 @@
|
|||
}.bind(this));
|
||||
},
|
||||
|
||||
addExpirationTimerUpdate: function(source, time) {
|
||||
addExpirationTimerUpdate: function(time, source) {
|
||||
var now = Date.now();
|
||||
this.save({ expireTimer: time });
|
||||
var message = this.messageCollection.add({
|
||||
conversationId : this.id,
|
||||
type : 'expirationTimerUpdate',
|
||||
sent_at : now,
|
||||
received_at : now,
|
||||
timerUpdate : {
|
||||
conversationId : this.id,
|
||||
type : 'outgoing',
|
||||
sent_at : now,
|
||||
received_at : now,
|
||||
flags : textsecure.protobuf.DataMessage.Flags.EXPIRATION_TIMER_UPDATE,
|
||||
expirationTimerUpdate : {
|
||||
expireTimer : time,
|
||||
source : source
|
||||
}
|
||||
});
|
||||
message.save();
|
||||
},
|
||||
sendExpirationTimerUpdate: function(time) {
|
||||
this.addExpirationTimerUpdate(time, textsecure.storage.user.getNumber());
|
||||
// todo: send.
|
||||
},
|
||||
|
||||
isSearchable: function() {
|
||||
return !this.get('left') || !!this.get('lastMessage');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue