Remove deprecated endpoint

This commit is contained in:
Fedor Indutny 2024-08-12 13:38:23 -07:00 committed by GitHub
parent 3a28aaab53
commit 89bdb68129
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 34 deletions

View file

@ -893,14 +893,6 @@ export async function startApp(): Promise<void> {
]); ]);
} }
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')) { if (window.isBeforeVersion(lastVersion, 'v1.32.0-beta.4')) {
drop(DataWriter.ensureFilePermissions()); drop(DataWriter.ensureFilePermissions());
} }
@ -962,6 +954,12 @@ export async function startApp(): Promise<void> {
await window.storage.remove('sendEditWarningShown'); await window.storage.remove('sendEditWarningShown');
await window.storage.remove('formattingWarningShown'); await window.storage.remove('formattingWarningShown');
} }
if (window.isBeforeVersion(lastVersion, 'v7.21.0-beta.1')) {
await window.storage.remove(
'hasRegisterSupportForUnauthenticatedDelivery'
);
}
} }
setAppLoadingScreenMessage( setAppLoadingScreenMessage(
@ -1825,19 +1823,6 @@ export async function startApp(): Promise<void> {
} }
} }
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(); const deviceId = window.textsecure.storage.user.getDeviceId();
if (!window.textsecure.storage.user.getAci()) { if (!window.textsecure.storage.user.getAci()) {

View file

@ -587,7 +587,6 @@ const URL_CALLS = {
storageToken: 'v1/storage/auth', storageToken: 'v1/storage/auth',
subscriptions: 'v1/subscription', subscriptions: 'v1/subscription',
subscriptionConfiguration: 'v1/subscription/configuration', subscriptionConfiguration: 'v1/subscription/configuration',
supportUnauthenticatedDelivery: 'v1/devices/unauthenticated_delivery',
updateDeviceName: 'v1/accounts/name', updateDeviceName: 'v1/accounts/name',
username: 'v1/accounts/username_hash', username: 'v1/accounts/username_hash',
reserveUsername: 'v1/accounts/username_hash/reserve', reserveUsername: 'v1/accounts/username_hash/reserve',
@ -619,7 +618,6 @@ const WEBSOCKET_CALLS = new Set<keyof typeof URL_CALLS>([
// Devices // Devices
'linkDevice', 'linkDevice',
'registerCapabilities', 'registerCapabilities',
'supportUnauthenticatedDelivery',
// Directory // Directory
'directoryAuthV2', 'directoryAuthV2',
@ -1346,7 +1344,6 @@ export type WebAPIType = {
genKeys: UploadKeysType, genKeys: UploadKeysType,
serviceIdKind: ServiceIdKind serviceIdKind: ServiceIdKind
) => Promise<void>; ) => Promise<void>;
registerSupportForUnauthenticatedDelivery: () => Promise<void>;
reportMessage: (options: ReportMessageOptionsType) => Promise<void>; reportMessage: (options: ReportMessageOptionsType) => Promise<void>;
requestVerification: ( requestVerification: (
number: string, number: string,
@ -1763,7 +1760,6 @@ export function initialize({
registerCapabilities, registerCapabilities,
registerKeys, registerKeys,
registerRequestHandler, registerRequestHandler,
registerSupportForUnauthenticatedDelivery,
resolveUsernameLink, resolveUsernameLink,
replaceUsernameLink, replaceUsernameLink,
reportMessage, reportMessage,
@ -2083,14 +2079,6 @@ export function initialize({
}); });
} }
async function registerSupportForUnauthenticatedDelivery() {
await _ajax({
call: 'supportUnauthenticatedDelivery',
httpType: 'PUT',
responseType: 'json',
});
}
async function registerCapabilities(capabilities: CapabilitiesUploadType) { async function registerCapabilities(capabilities: CapabilitiesUploadType) {
await _ajax({ await _ajax({
call: 'registerCapabilities', call: 'registerCapabilities',

View file

@ -73,7 +73,6 @@ export type StorageAccessType = {
customColors: CustomColorsItemType; customColors: CustomColorsItemType;
device_name: string; device_name: string;
existingOnboardingStoryMessageIds: ReadonlyArray<string> | undefined; existingOnboardingStoryMessageIds: ReadonlyArray<string> | undefined;
hasRegisterSupportForUnauthenticatedDelivery: boolean;
hasSetMyStoriesPrivacy: boolean; hasSetMyStoriesPrivacy: boolean;
hasCompletedUsernameOnboarding: boolean; hasCompletedUsernameOnboarding: boolean;
hasCompletedUsernameLinkOnboarding: boolean; hasCompletedUsernameLinkOnboarding: boolean;
@ -188,6 +187,7 @@ export type StorageAccessType = {
lastStartup: never; lastStartup: never;
sendEditWarningShown: never; sendEditWarningShown: never;
formattingWarningShown: never; formattingWarningShown: never;
hasRegisterSupportForUnauthenticatedDelivery: never;
}; };
export type StorageInterface = { export type StorageInterface = {