diff --git a/ts/RemoteConfig.ts b/ts/RemoteConfig.ts index 4eac88bdf8..8809f6b478 100644 --- a/ts/RemoteConfig.ts +++ b/ts/RemoteConfig.ts @@ -19,6 +19,7 @@ export type ConfigKeyType = | 'desktop.screensharing2' | 'desktop.senderKey.send' | 'desktop.senderKey.retry' + | 'desktop.sendSenderKey2' | 'desktop.storage' | 'desktop.storageWrite3' | 'desktop.worksAtSignal' diff --git a/ts/background.ts b/ts/background.ts index 567af6ddc3..f288f43c8a 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -2314,7 +2314,9 @@ export async function startApp(): Promise { announcementGroup: true, 'gv2-3': true, 'gv1-migration': true, - senderKey: true, + senderKey: window.Signal.RemoteConfig.isEnabled( + 'desktop.sendSenderKey2' + ), }); } catch (error) { window.log.error( diff --git a/ts/textsecure/WebAPI.ts b/ts/textsecure/WebAPI.ts index 499272879e..ea371f4e49 100644 --- a/ts/textsecure/WebAPI.ts +++ b/ts/textsecure/WebAPI.ts @@ -764,10 +764,10 @@ export type CapabilitiesType = { senderKey: boolean; }; export type CapabilitiesUploadType = { - announcementGroup: true; - 'gv2-3': true; - 'gv1-migration': true; - senderKey: true; + announcementGroup: boolean; + 'gv2-3': boolean; + 'gv1-migration': boolean; + senderKey: boolean; }; type StickerPackManifestType = any; @@ -1494,7 +1494,7 @@ export function initialize({ announcementGroup: true, 'gv2-3': true, 'gv1-migration': true, - senderKey: true, + senderKey: false, }; const { accessKey, uuid } = options; diff --git a/ts/util/sendToGroup.ts b/ts/util/sendToGroup.ts index d5f993dc8b..bd7ffab10a 100644 --- a/ts/util/sendToGroup.ts +++ b/ts/util/sendToGroup.ts @@ -19,6 +19,7 @@ import { SenderCertificateMode, SendLogCallbackType, } from '../textsecure/OutgoingMessage'; +import { isEnabled } from '../RemoteConfig'; import { isOlderThan } from './timestamp'; import { @@ -146,6 +147,7 @@ export async function sendContentMessageToGroup({ const ourConversation = window.ConversationController.get(ourConversationId); if ( + isEnabled('desktop.sendSenderKey2') && ourConversation?.get('capabilities')?.senderKey && RemoteConfig.isEnabled('desktop.senderKey.send') && isGroupV2(conversation.attributes)