From 01d04bd4d3a459a0331a05dd7bbbf7ecf3aff060 Mon Sep 17 00:00:00 2001 From: William Grant Date: Fri, 13 Oct 2023 13:43:59 +1100 Subject: [PATCH] refactor: existingexpration to existingexpirationt in createClosedGroups.ts. Cleaned up some comments --- ts/session/apis/snode_api/snodeSignatures.ts | 3 --- ts/session/constants.ts | 2 +- ts/session/conversations/createClosedGroup.ts | 10 +++++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ts/session/apis/snode_api/snodeSignatures.ts b/ts/session/apis/snode_api/snodeSignatures.ts index bc952aff9..fa05f0d33 100644 --- a/ts/session/apis/snode_api/snodeSignatures.ts +++ b/ts/session/apis/snode_api/snodeSignatures.ts @@ -138,9 +138,6 @@ async function generateUpdateExpirySignature({ } } -/** - * NOTE if shortenOrExtend is an empty string it means we want to hardcode the expiry to a TTL value, otherwise it's to shorten or extend the TTL - */ async function generateGetExpiriesSignature({ timestamp, messageHashes, diff --git a/ts/session/constants.ts b/ts/session/constants.ts index 7caa1b42a..e74cb2c7e 100644 --- a/ts/session/constants.ts +++ b/ts/session/constants.ts @@ -3,7 +3,7 @@ const minutes = seconds * 60; const hours = minutes * 60; const days = hours * 24; -/** in millisecond */ +/** in milliseconds */ export const DURATION = { /** 1000ms */ SECONDS: seconds, diff --git a/ts/session/conversations/createClosedGroup.ts b/ts/session/conversations/createClosedGroup.ts index ecbbd1e5e..bb4601dba 100644 --- a/ts/session/conversations/createClosedGroup.ts +++ b/ts/session/conversations/createClosedGroup.ts @@ -103,7 +103,7 @@ async function sendToGroupMembers( groupName: string, admins: Array, encryptionKeyPair: ECKeyPair, - existingExprationType: DisappearAfterSendOnly, + existingExpirationType: DisappearAfterSendOnly, existingExpireTimer: number, isRetry: boolean = false ): Promise { @@ -113,7 +113,7 @@ async function sendToGroupMembers( groupName, admins, encryptionKeyPair, - existingExprationType, + existingExpirationType, existingExpireTimer ); window?.log?.info(`Sending invites for group ${groupPublicKey} to ${listOfMembers}`); @@ -169,7 +169,7 @@ async function sendToGroupMembers( groupName, admins, encryptionKeyPair, - existingExprationType, + existingExpirationType, existingExpireTimer, isRetrySend ); @@ -187,7 +187,7 @@ function createInvitePromises( groupName: string, admins: Array, encryptionKeyPair: ECKeyPair, - existingExprationType: DisappearingMessageType, + existingExpirationType: DisappearingMessageType, existingExpireTimer: number ) { return listOfMembers.map(async m => { @@ -198,7 +198,7 @@ function createInvitePromises( admins, keypair: encryptionKeyPair, timestamp: Date.now(), - expirationType: existingExprationType, + expirationType: existingExpirationType, expireTimer: existingExpireTimer, }; const message = new ClosedGroupNewMessage(messageParams);