Add "pni" capability in staging

This commit is contained in:
Fedor Indutny 2022-12-20 12:29:17 -08:00 committed by GitHub
parent d8ea9856ec
commit 57eed10a38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View file

@ -40,6 +40,7 @@ import { assertDev, strictAssert } from './util/assert';
import { normalizeUuid } from './util/normalizeUuid';
import { filter } from './util/iterables';
import { isNotNil } from './util/isNotNil';
import { isPnpEnabled } from './util/isPnpEnabled';
import { setAppLoadingScreenMessage } from './setAppLoadingScreenMessage';
import { IdleDetector } from './IdleDetector';
import { expiringMessagesDeletionService } from './services/expiringMessagesDeletion';
@ -2302,6 +2303,7 @@ export async function startApp(): Promise<void> {
senderKey: true,
changeNumber: true,
stories: true,
pni: isPnpEnabled(),
}),
updateOurUsernameAndPni(),
]);

View file

@ -27,6 +27,7 @@ import { getStreamWithTimeout } from '../util/getStreamWithTimeout';
import { formatAcceptLanguageHeader } from '../util/userLanguages';
import { toWebSafeBase64 } from '../util/webSafeBase64';
import { getBasicAuth } from '../util/getBasicAuth';
import { isPnpEnabled } from '../util/isPnpEnabled';
import type { SocketStatus } from '../types/SocketStatus';
import { toLogFormat } from '../types/errors';
import { isPackIdValid, redactPackId } from '../types/Stickers';
@ -612,6 +613,7 @@ export type CapabilitiesType = {
senderKey: boolean;
changeNumber: boolean;
stories: boolean;
pni: boolean;
};
export type CapabilitiesUploadType = {
announcementGroup: true;
@ -620,6 +622,9 @@ export type CapabilitiesUploadType = {
senderKey: true;
changeNumber: true;
stories: true;
// true in staging, false in production
pni: boolean;
};
type StickerPackManifestType = Uint8Array;
@ -1857,6 +1862,7 @@ export function initialize({
senderKey: true,
changeNumber: true,
stories: true,
pni: isPnpEnabled(),
};
const jsonData = {

8
ts/util/isPnpEnabled.ts Normal file
View file

@ -0,0 +1,8 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { isStaging } from './version';
export function isPnpEnabled(version = window.getVersion()): boolean {
return isStaging(version);
}