diff --git a/ts/background.ts b/ts/background.ts index 19244f6891..dfe0599ac6 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -893,14 +893,6 @@ export async function startApp(): Promise { ]); } - if (window.isBeforeVersion(lastVersion, 'v1.26.0')) { - // Ensure that we re-register our support for sealed sender - await window.storage.put( - 'hasRegisterSupportForUnauthenticatedDelivery', - false - ); - } - if (window.isBeforeVersion(lastVersion, 'v1.32.0-beta.4')) { drop(DataWriter.ensureFilePermissions()); } @@ -962,6 +954,12 @@ export async function startApp(): Promise { await window.storage.remove('sendEditWarningShown'); await window.storage.remove('formattingWarningShown'); } + + if (window.isBeforeVersion(lastVersion, 'v7.21.0-beta.1')) { + await window.storage.remove( + 'hasRegisterSupportForUnauthenticatedDelivery' + ); + } } setAppLoadingScreenMessage( @@ -1825,19 +1823,6 @@ export async function startApp(): Promise { } } - const udSupportKey = 'hasRegisterSupportForUnauthenticatedDelivery'; - if (!window.storage.get(udSupportKey)) { - try { - await server.registerSupportForUnauthenticatedDelivery(); - await window.storage.put(udSupportKey, true); - } catch (error) { - log.error( - 'Error: Unable to register for unauthenticated delivery support.', - Errors.toLogFormat(error) - ); - } - } - const deviceId = window.textsecure.storage.user.getDeviceId(); if (!window.textsecure.storage.user.getAci()) { diff --git a/ts/textsecure/WebAPI.ts b/ts/textsecure/WebAPI.ts index 430e87167b..999fec1e6f 100644 --- a/ts/textsecure/WebAPI.ts +++ b/ts/textsecure/WebAPI.ts @@ -587,7 +587,6 @@ const URL_CALLS = { storageToken: 'v1/storage/auth', subscriptions: 'v1/subscription', subscriptionConfiguration: 'v1/subscription/configuration', - supportUnauthenticatedDelivery: 'v1/devices/unauthenticated_delivery', updateDeviceName: 'v1/accounts/name', username: 'v1/accounts/username_hash', reserveUsername: 'v1/accounts/username_hash/reserve', @@ -619,7 +618,6 @@ const WEBSOCKET_CALLS = new Set([ // Devices 'linkDevice', 'registerCapabilities', - 'supportUnauthenticatedDelivery', // Directory 'directoryAuthV2', @@ -1346,7 +1344,6 @@ export type WebAPIType = { genKeys: UploadKeysType, serviceIdKind: ServiceIdKind ) => Promise; - registerSupportForUnauthenticatedDelivery: () => Promise; reportMessage: (options: ReportMessageOptionsType) => Promise; requestVerification: ( number: string, @@ -1763,7 +1760,6 @@ export function initialize({ registerCapabilities, registerKeys, registerRequestHandler, - registerSupportForUnauthenticatedDelivery, resolveUsernameLink, replaceUsernameLink, reportMessage, @@ -2083,14 +2079,6 @@ export function initialize({ }); } - async function registerSupportForUnauthenticatedDelivery() { - await _ajax({ - call: 'supportUnauthenticatedDelivery', - httpType: 'PUT', - responseType: 'json', - }); - } - async function registerCapabilities(capabilities: CapabilitiesUploadType) { await _ajax({ call: 'registerCapabilities', diff --git a/ts/types/Storage.d.ts b/ts/types/Storage.d.ts index 20b948840d..2f8771bbbb 100644 --- a/ts/types/Storage.d.ts +++ b/ts/types/Storage.d.ts @@ -73,7 +73,6 @@ export type StorageAccessType = { customColors: CustomColorsItemType; device_name: string; existingOnboardingStoryMessageIds: ReadonlyArray | undefined; - hasRegisterSupportForUnauthenticatedDelivery: boolean; hasSetMyStoriesPrivacy: boolean; hasCompletedUsernameOnboarding: boolean; hasCompletedUsernameLinkOnboarding: boolean; @@ -188,6 +187,7 @@ export type StorageAccessType = { lastStartup: never; sendEditWarningShown: never; formattingWarningShown: never; + hasRegisterSupportForUnauthenticatedDelivery: never; }; export type StorageInterface = {