From 22c64395d967fcec4bee03f8df0d4f0ec6a56961 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Tue, 4 Aug 2020 12:45:12 +1000 Subject: [PATCH] Remove multi-device warnings --- _locales/en/messages.json | 12 -------- ts/components/session/ActionsPanel.tsx | 42 -------------------------- ts/receiver/multidevice.ts | 3 ++ 3 files changed, 3 insertions(+), 54 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 4aaad9806..0e015833f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1306,18 +1306,6 @@ "message": "MultiDevice disabled temporarily", "description": "Description of why multi device is disabled" }, - "multiDeviceDisabledTemporaryTitle": { - "message": "Changes to Multi-device", - "description": "Description of why multi device is disabled on app start" - }, - "multiDeviceDisabledTemporaryDescriptionPrimary": { - "message": "You’re seeing this because you have a secondary device linked to your Session ID. To improve reliability and stability, we’ve decided to temporarily disable Session’s multi-device functionality. Device linking has been disabled, and existing secondary clients will be erased on August 6th.

To read more about this change, visit the Session FAQ at getsession.org/faq.", - "description": "Description of why multi device is disabled on app start for a primary device" - }, - "multiDeviceDisabledTemporaryDescriptionSecondary": { - "message": "You’re seeing this because this is a secondary device in a multi-device setup. To improve reliability and stability, we’ve decided to temporarily disable Session’s multi-device functionality. Device linking has been disabled, and existing secondary clients will be erased on August 6th.

To read more about this change, visit the Session FAQ at getsession.org/faq.", - "description": "Description of why multi device is disabled on app start for a secondary device" - }, "messageTTL": { "message": "Message TTL", "description": "Title of the Message TTL setting" diff --git a/ts/components/session/ActionsPanel.tsx b/ts/components/session/ActionsPanel.tsx index 484a3b89f..84d653bfa 100644 --- a/ts/components/session/ActionsPanel.tsx +++ b/ts/components/session/ActionsPanel.tsx @@ -59,48 +59,6 @@ export class ActionsPanel extends React.Component { }, 'refreshAvatarCallback' ); - setTimeout(async () => { - const disabledMultiDeviceCountDb = await getItemById( - 'disabledMultiDeviceCount' - ); - const disabledMultiDeviceCount = - Number(disabledMultiDeviceCountDb?.value) || 0; - const data = { - id: 'disabledMultiDeviceCount', - value: String(disabledMultiDeviceCount + 1), - }; - await createOrUpdateItem(data); - if (disabledMultiDeviceCount % 5 !== 0) { - return; - } - const currentDevice = await UserUtil.getCurrentDevicePubKey(); - if (!currentDevice) { - return; - } - const secondaryDevices = await MultiDeviceProtocol.getSecondaryDevices( - currentDevice - ); - const isSecondary = - secondaryDevices.find(s => s.key === currentDevice) || - !!window.textsecure.storage.get('isSecondaryDevice'); - - const hasMultipleDevices = - (await MultiDeviceProtocol.getOurDevices()).length > 1; - const primaryWithSecondary = !isSecondary && hasMultipleDevices; - - if (!primaryWithSecondary && !isSecondary) { - return; - } - - const opts = { - hideCancel: true, - title: window.i18n('multiDeviceDisabledTemporaryTitle'), - message: primaryWithSecondary - ? window.i18n('multiDeviceDisabledTemporaryDescriptionPrimary') - : window.i18n('multiDeviceDisabledTemporaryDescriptionSecondary'), - }; - window.Whisper.events.trigger('showConfirmationDialog', opts); - }, 1000); } ); } diff --git a/ts/receiver/multidevice.ts b/ts/receiver/multidevice.ts index d0caa6c42..c1c69261d 100644 --- a/ts/receiver/multidevice.ts +++ b/ts/receiver/multidevice.ts @@ -88,6 +88,9 @@ export async function handlePairingAuthorisationMessage( dataMessage: SignalService.IDataMessage | undefined | null ): Promise { if (!window.lokiFeatureFlags.useMultiDevice) { + window.log.info( + `Received a pairing authorisation message from ${envelope.source} while multi device is disabled.` + ); await removeFromCache(envelope); return; }