Disable multi device

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

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

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

@ -28,6 +28,11 @@ export class MultiDeviceProtocol {
public static async fetchPairingAuthorisationsIfNeeded( public static async fetchPairingAuthorisationsIfNeeded(
device: PubKey device: PubKey
): Promise<void> { ): 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 // This return here stops an infinite loop when we get all our other devices
const ourKey = await UserUtil.getCurrentDevicePubKey(); const ourKey = await UserUtil.getCurrentDevicePubKey();
if (!ourKey || device.key === ourKey) { if (!ourKey || device.key === ourKey) {

12
ts/window.d.ts vendored

@ -51,7 +51,17 @@ declare global {
libloki: Libloki; libloki: Libloki;
libsignal: LibsignalProtocol; libsignal: LibsignalProtocol;
log: any; 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; lokiFileServerAPI: LokiFileServerInstance;
lokiMessageAPI: LokiMessageInterface; lokiMessageAPI: LokiMessageInterface;
lokiPublicChatAPI: LokiPublicChatFactoryInterface; lokiPublicChatAPI: LokiPublicChatFactoryInterface;

Loading…
Cancel
Save