Move expiring message time earlier if read sync has earlier time

This commit is contained in:
Scott Nonnenberg 2018-08-06 11:31:41 -07:00
parent a01db40e27
commit 9ed1ee90f8
3 changed files with 38 additions and 20 deletions

View file

@ -1289,8 +1289,8 @@
}
return msFromNow;
},
async setToExpire() {
if (this.isExpiring() && !this.get('expires_at')) {
async setToExpire(force = false) {
if (this.isExpiring() && (force || !this.get('expires_at'))) {
const start = this.get('expirationStartTimestamp');
const delta = this.get('expireTimer') * 1000;
const expiresAt = start + delta;