Pass disableIPv6 setting to libsignal-net

This commit is contained in:
Sergey Skrobotov 2024-04-23 16:54:24 -07:00 committed by GitHub
parent 793346031b
commit ae4fa04e95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View file

@ -640,6 +640,7 @@ type InitializeOptionsType = {
version: string;
directoryConfig: DirectoryConfigType;
libsignalNetEnvironment: string | undefined;
disableIPv6: boolean;
};
export type MessageType = Readonly<{
@ -1459,6 +1460,7 @@ export function initialize({
proxyUrl,
version,
libsignalNetEnvironment,
disableIPv6,
}: InitializeOptionsType): WebAPIConnectType {
if (!isString(url)) {
throw new Error('WebAPI.initialize: Invalid server url');
@ -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.