Merge pull request #1988 from Bilb/disable-settings-video-feature-off

Disable settings video feature off
pull/1987/head
Audric Ackermann 4 years ago committed by GitHub
commit c83ec7a04f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -39,10 +39,6 @@ window.isBehindProxy = () => Boolean(config.proxyUrl);
window.lokiFeatureFlags = { window.lokiFeatureFlags = {
useOnionRequests: true, useOnionRequests: true,
useFileOnionRequests: true,
useFileOnionRequestsV2: true, // more compact encoding of files in response
padOutgoingAttachments: true,
enablePinConversations: true,
useCallMessage: false, useCallMessage: false,
}; };

@ -147,7 +147,7 @@ export const getPinConversationMenuItem = (conversationId: string): JSX.Element
const isMessagesSection = useSelector(getFocusedSection) === SectionType.Message; const isMessagesSection = useSelector(getFocusedSection) === SectionType.Message;
const nbOfAlreadyPinnedConvos = useSelector(getNumberOfPinnedConversations); const nbOfAlreadyPinnedConvos = useSelector(getNumberOfPinnedConversations);
if (isMessagesSection && window.lokiFeatureFlags.enablePinConversations) { if (isMessagesSection) {
const conversation = getConversationController().get(conversationId); const conversation = getConversationController().get(conversationId);
const isPinned = conversation.isPinned(); const isPinned = conversation.isPinned();

@ -66,15 +66,17 @@ export const SettingsCategoryPrivacy = (props: {
active={Boolean(window.getSettingValue('media-permissions'))} active={Boolean(window.getSettingValue('media-permissions'))}
/> />
<SessionToggleWithDescription {window.lokiFeatureFlags.useCallMessage && (
onClickToggle={async () => { <SessionToggleWithDescription
await toggleCallMediaPermissions(forceUpdate); onClickToggle={async () => {
forceUpdate(); await toggleCallMediaPermissions(forceUpdate);
}} forceUpdate();
title={window.i18n('callMediaPermissionsTitle')} }}
description={window.i18n('callMediaPermissionsDescription')} title={window.i18n('callMediaPermissionsTitle')}
active={Boolean(window.getCallMediaPermissions())} description={window.i18n('callMediaPermissionsDescription')}
/> active={Boolean(window.getCallMediaPermissions())}
/>
)}
<SessionToggleWithDescription <SessionToggleWithDescription
onClickToggle={() => { onClickToggle={() => {
const old = Boolean(window.getSettingValue(settingsReadReceipt)); const old = Boolean(window.getSettingValue(settingsReadReceipt));

@ -695,7 +695,7 @@ export const TEST_getMinTimeout = () => 500;
*/ */
// tslint:disable-next-line: max-func-body-length // tslint:disable-next-line: max-func-body-length
export const networkDeleteMessages = async ( export const networkDeleteMessages = async (
hashes: Array<string>, hashes: Array<string>
): Promise<Array<string> | null> => { ): Promise<Array<string> | null> => {
const sodium = await getSodium(); const sodium = await getSodium();
const userX25519PublicKey = UserUtils.getOurPubKeyStrFromCache(); const userX25519PublicKey = UserUtils.getOurPubKeyStrFromCache();

@ -125,7 +125,7 @@ async function buildOnionCtxs(
const isCallToPn = const isCallToPn =
finalRelayOptions?.host === hrefPnServerDev || finalRelayOptions?.host === hrefPnServerProd; finalRelayOptions?.host === hrefPnServerDev || finalRelayOptions?.host === hrefPnServerProd;
if (!isCallToPn && window.lokiFeatureFlags.useFileOnionRequestsV2) { if (!isCallToPn) {
target = '/loki/v3/lsrpc'; target = '/loki/v3/lsrpc';
} }

@ -69,10 +69,7 @@ export class AttachmentFsV2Utils {
pointer.key = new Uint8Array(crypto.randomBytes(64)); pointer.key = new Uint8Array(crypto.randomBytes(64));
const iv = new Uint8Array(crypto.randomBytes(16)); const iv = new Uint8Array(crypto.randomBytes(16));
const dataToEncrypt = const dataToEncrypt = !shouldPad ? attachment.data : addAttachmentPadding(attachment.data);
!shouldPad || !window.lokiFeatureFlags.padOutgoingAttachments
? attachment.data
: addAttachmentPadding(attachment.data);
const data = await window.textsecure.crypto.encryptAttachment( const data = await window.textsecure.crypto.encryptAttachment(
dataToEncrypt, dataToEncrypt,
pointer.key.buffer, pointer.key.buffer,

@ -38,10 +38,9 @@ export async function uploadV2(params: UploadParamsV2): Promise<AttachmentPointe
caption: attachment.caption, caption: attachment.caption,
}; };
const paddedAttachment: ArrayBuffer = const paddedAttachment: ArrayBuffer = !openGroup
window.lokiFeatureFlags.padOutgoingAttachments && !openGroup ? addAttachmentPadding(attachment.data)
? addAttachmentPadding(attachment.data) : attachment.data;
: attachment.data;
const fileDetails = await uploadFileOpenGroupV2(new Uint8Array(paddedAttachment), openGroup); const fileDetails = await uploadFileOpenGroupV2(new Uint8Array(paddedAttachment), openGroup);

4
ts/window.d.ts vendored

@ -43,10 +43,6 @@ declare global {
log: any; log: any;
lokiFeatureFlags: { lokiFeatureFlags: {
useOnionRequests: boolean; useOnionRequests: boolean;
useFileOnionRequests: boolean;
useFileOnionRequestsV2: boolean;
padOutgoingAttachments: boolean;
enablePinConversations: boolean;
useCallMessage: boolean; useCallMessage: boolean;
}; };
lokiSnodeAPI: LokiSnodeAPI; lokiSnodeAPI: LokiSnodeAPI;

Loading…
Cancel
Save