Send timer update messages when changing the timer

This commit is contained in:
lilia 2016-09-28 17:10:39 -07:00
parent 824b7417e9
commit 6074a29046
3 changed files with 112 additions and 30 deletions

View file

@ -182,10 +182,18 @@
}
});
message.save();
return message;
},
sendExpirationTimerUpdate: function(time) {
this.addExpirationTimerUpdate(time, textsecure.storage.user.getNumber());
// todo: send.
var message = this.addExpirationTimerUpdate(time, textsecure.storage.user.getNumber());
var sendFunc;
if (this.get('type') == 'private') {
sendFunc = textsecure.messaging.sendExpirationTimerUpdateToNumber;
}
else {
sendFunc = textsecure.messaging.sendExpirationTimerUpdateToGroup;
}
message.send(sendFunc(this.get('id'), this.get('expireTimer'), message.get('sent_at')));
},
isSearchable: function() {