refactor: replaced get expires_at calls

with getExpiresAt
pull/2971/head
William Grant 2 years ago
parent 61eccb8d0f
commit 0dcf48be16

@ -1162,7 +1162,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
} }
public async setToExpire() { public async setToExpire() {
if (this.isExpiring() && !this.get('expires_at')) { if (this.isExpiring() && !this.getExpiresAt()) {
const start = this.getExpirationStartTimestamp(); const start = this.getExpirationStartTimestamp();
const delta = this.getExpireTimer() * 1000; const delta = this.getExpireTimer() * 1000;
if (!start) { if (!start) {

@ -128,7 +128,7 @@ async function checkExpiringMessages() {
return; return;
} }
const expiresAt = next.get('expires_at'); const expiresAt = next.getExpiresAt();
if (!expiresAt) { if (!expiresAt) {
return; return;
} }
@ -670,7 +670,7 @@ export async function updateMessageExpiryOnSwarm(
expireTimer: message.getExpireTimer() * 1000, expireTimer: message.getExpireTimer() * 1000,
shorten: true, shorten: true,
}); });
const expiresAt = message.get('expires_at'); const expiresAt = message.getExpiresAt();
if (newTTL && newTTL !== expiresAt) { if (newTTL && newTTL !== expiresAt) {
message.set({ message.set({

Loading…
Cancel
Save