Skip to content

Commit

Permalink
Pass disableIPv6 setting to libsignal-net
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-signal committed Apr 23, 2024
1 parent 7933460 commit ae4fa04
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ts/textsecure/SocketManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,6 @@ export class SocketManager extends EventListener {
: TransportOption.ShadowingLow;
}

// in prod, switch to using 'ShadowingHigh' mode, unless user opts out,
// in which case switching to `ShadowingLow`
const configValue = window.Signal.RemoteConfig.isEnabled(
'desktop.experimentalTransportEnabled.prod'
);
Expand Down
3 changes: 3 additions & 0 deletions ts/textsecure/WebAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ type InitializeOptionsType = {
version: string;
directoryConfig: DirectoryConfigType;
libsignalNetEnvironment: string | undefined;
disableIPv6: boolean;
};

export type MessageType = Readonly<{
Expand Down Expand Up @@ -1459,6 +1460,7 @@ export function initialize({
proxyUrl,
version,
libsignalNetEnvironment,
disableIPv6,
}: InitializeOptionsType): WebAPIConnectType {
if (!isString(url)) {
throw new Error('WebAPI.initialize: Invalid server url');
Expand Down Expand Up @@ -1510,6 +1512,7 @@ export function initialize({
);
log.info(`libsignal net environment resolved to [${Net.Environment[env]}]`);
const libsignalNet = new Net.Net(env);
libsignalNet.setIpv6Enabled(!disableIPv6);

// Thanks to function-hoisting, we can put this return statement before all of the
// below function definitions.
Expand Down
1 change: 1 addition & 0 deletions ts/windows/main/phase2-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ window.WebAPI = window.textsecure.WebAPI.initialize({
proxyUrl: config.proxyUrl,
version: config.version,
libsignalNetEnvironment: config.libsignalNetEnvironment,
disableIPv6: config.disableIPv6,
});

window.libphonenumberInstance = PhoneNumberUtil.getInstance();
Expand Down

0 comments on commit ae4fa04

Please sign in to comment.