From dd281de9035fcb228ab1cad6c21b183b6aae674a Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 27 Oct 2021 13:57:14 +1100 Subject: [PATCH] cleanup feature flags --- preload.js | 4 ---- ts/components/session/menu/Menu.tsx | 2 +- ts/session/snode_api/SNodeAPI.ts | 2 +- ts/session/snode_api/onions.ts | 2 +- ts/session/utils/Attachments.ts | 5 +---- ts/session/utils/AttachmentsV2.ts | 7 +++---- ts/window.d.ts | 4 ---- 7 files changed, 7 insertions(+), 19 deletions(-) diff --git a/preload.js b/preload.js index d5bd8746d..ee1969b81 100644 --- a/preload.js +++ b/preload.js @@ -39,10 +39,6 @@ window.isBehindProxy = () => Boolean(config.proxyUrl); window.lokiFeatureFlags = { useOnionRequests: true, - useFileOnionRequests: true, - useFileOnionRequestsV2: true, // more compact encoding of files in response - padOutgoingAttachments: true, - enablePinConversations: true, useCallMessage: false, }; diff --git a/ts/components/session/menu/Menu.tsx b/ts/components/session/menu/Menu.tsx index 17f5606d5..7a31dd885 100644 --- a/ts/components/session/menu/Menu.tsx +++ b/ts/components/session/menu/Menu.tsx @@ -147,7 +147,7 @@ export const getPinConversationMenuItem = (conversationId: string): JSX.Element const isMessagesSection = useSelector(getFocusedSection) === SectionType.Message; const nbOfAlreadyPinnedConvos = useSelector(getNumberOfPinnedConversations); - if (isMessagesSection && window.lokiFeatureFlags.enablePinConversations) { + if (isMessagesSection) { const conversation = getConversationController().get(conversationId); const isPinned = conversation.isPinned(); diff --git a/ts/session/snode_api/SNodeAPI.ts b/ts/session/snode_api/SNodeAPI.ts index 849da9af7..57c7516f4 100644 --- a/ts/session/snode_api/SNodeAPI.ts +++ b/ts/session/snode_api/SNodeAPI.ts @@ -695,7 +695,7 @@ export const TEST_getMinTimeout = () => 500; */ // tslint:disable-next-line: max-func-body-length export const networkDeleteMessages = async ( - hashes: Array, + hashes: Array ): Promise | null> => { const sodium = await getSodium(); const userX25519PublicKey = UserUtils.getOurPubKeyStrFromCache(); diff --git a/ts/session/snode_api/onions.ts b/ts/session/snode_api/onions.ts index cea12d487..ccd5c4594 100644 --- a/ts/session/snode_api/onions.ts +++ b/ts/session/snode_api/onions.ts @@ -125,7 +125,7 @@ async function buildOnionCtxs( const isCallToPn = finalRelayOptions?.host === hrefPnServerDev || finalRelayOptions?.host === hrefPnServerProd; - if (!isCallToPn && window.lokiFeatureFlags.useFileOnionRequestsV2) { + if (!isCallToPn) { target = '/loki/v3/lsrpc'; } diff --git a/ts/session/utils/Attachments.ts b/ts/session/utils/Attachments.ts index 30c226365..8e1471f75 100644 --- a/ts/session/utils/Attachments.ts +++ b/ts/session/utils/Attachments.ts @@ -69,10 +69,7 @@ export class AttachmentFsV2Utils { pointer.key = new Uint8Array(crypto.randomBytes(64)); const iv = new Uint8Array(crypto.randomBytes(16)); - const dataToEncrypt = - !shouldPad || !window.lokiFeatureFlags.padOutgoingAttachments - ? attachment.data - : addAttachmentPadding(attachment.data); + const dataToEncrypt = !shouldPad ? attachment.data : addAttachmentPadding(attachment.data); const data = await window.textsecure.crypto.encryptAttachment( dataToEncrypt, pointer.key.buffer, diff --git a/ts/session/utils/AttachmentsV2.ts b/ts/session/utils/AttachmentsV2.ts index b62a92470..b352ab221 100644 --- a/ts/session/utils/AttachmentsV2.ts +++ b/ts/session/utils/AttachmentsV2.ts @@ -38,10 +38,9 @@ export async function uploadV2(params: UploadParamsV2): Promise