Disable multi device

pull/1298/head
Mikunj 5 years ago
parent fad00a4ebd
commit c0fca99485

@ -456,6 +456,7 @@ window.lokiFeatureFlags = {
enableSenderKeys: false,
onionRequestHops: 3,
debugMessageLogs: process.env.ENABLE_MESSAGE_LOGS,
useMultiDevice: false,
};
// eslint-disable-next-line no-extend-native,func-names
@ -492,6 +493,7 @@ if (config.environment.includes('test-integration')) {
useFileOnionRequests: false,
debugMessageLogs: true,
enableSenderKeys: true,
useMultiDevice: false,
};
}

@ -87,6 +87,11 @@ export async function handlePairingAuthorisationMessage(
pairingAuthorisation: SignalService.IPairingAuthorisationMessage,
dataMessage: SignalService.IDataMessage | undefined | null
): Promise<void> {
if (!window.lokiFeatureFlags.useMultiDevice) {
await removeFromCache(envelope);
return;
}
const { secondaryDevicePubKey, grantSignature } = pairingAuthorisation;
const isGrant =
grantSignature &&

@ -28,6 +28,11 @@ export class MultiDeviceProtocol {
public static async fetchPairingAuthorisationsIfNeeded(
device: PubKey
): Promise<void> {
// Disable fetching if we don't want to use multi device
if (!window.lokiFeatureFlags.useMultiDevice) {
return;
}
// This return here stops an infinite loop when we get all our other devices
const ourKey = await UserUtil.getCurrentDevicePubKey();
if (!ourKey || device.key === ourKey) {

12
ts/window.d.ts vendored

@ -51,7 +51,17 @@ declare global {
libloki: Libloki;
libsignal: LibsignalProtocol;
log: any;
lokiFeatureFlags: any;
lokiFeatureFlags: {
multiDeviceUnpairing: boolean,
privateGroupChats: boolean,
useSnodeProxy: boolean,
useOnionRequests: boolean,
useFileOnionRequests: boolean,
enableSenderKeys: boolean,
onionRequestHops: number,
debugMessageLogs: boolean,
useMultiDevice: boolean,
};
lokiFileServerAPI: LokiFileServerInstance;
lokiMessageAPI: LokiMessageInterface;
lokiPublicChatAPI: LokiPublicChatFactoryInterface;

Loading…
Cancel
Save