diff --git a/ts/models/message.ts b/ts/models/message.ts index efb5b6691..5bbc9eb22 100644 --- a/ts/models/message.ts +++ b/ts/models/message.ts @@ -1179,7 +1179,7 @@ export class MessageModel extends Backbone.Model { if (messageHash) { await expireMessageOnSnode({ messageHash, - expireTimer: this.get('expireTimer'), + expireTimer: this.get('expireTimer') * 1000, shorten: true, }); } diff --git a/ts/models/messageType.ts b/ts/models/messageType.ts index 7cf51cd1d..50374ca33 100644 --- a/ts/models/messageType.ts +++ b/ts/models/messageType.ts @@ -25,9 +25,9 @@ export interface MessageAttributes { reacts?: ReactionList; reactsIndex?: number; body?: string; - // NOTE this is used for the logic expirationType?: DisappearingMessageType; - expireTimer: number; // in seconds, 0 means no expiration + /** in seconds, 0 means no expiration */ + expireTimer: number; expirationStartTimestamp: number; expires_at?: number; // NOTE this is used for conversation setting diff --git a/ts/session/apis/snode_api/expire.ts b/ts/session/apis/snode_api/expire.ts index 5b04ab23f..ebee674ec 100644 --- a/ts/session/apis/snode_api/expire.ts +++ b/ts/session/apis/snode_api/expire.ts @@ -157,7 +157,7 @@ async function expireOnNodes(targetNode: Snode, expireRequest: UpdateExpiryOnNod ); const firstExpirationResult = Object.entries(expirationResults).at(0); window.log.debug( - `WIP: expireOnNodes attempt complete. Here are the results from one of the snodes.\nmessageHash: ${ + `WIP: expireOnNodes succeeded! Here are the results from one of the snodes.\nmessageHash: ${ firstExpirationResult?.[0] } \nexpires at: ${ firstExpirationResult?.[1]?.expiry @@ -252,7 +252,7 @@ async function buildExpireRequest( * Sends an 'expire' request to the user's swarm for a specific message. * This supports both extending and shortening a message's TTL. * @param messageHash the hash of the message to expire - * @param expireTimer the new TTL for the message + * @param expireTimer amount of time until we expire the message from now in milliseconds * @param extend whether to extend the message's TTL * @param shorten whether to shorten the message's TTL */