API: Update client code name (#3752)

This commit is contained in:
Alexander Zinchuk 2023-09-04 04:05:04 +02:00
parent 081eca103e
commit 1de3f4811e
4 changed files with 6 additions and 5 deletions

View File

@ -14,7 +14,7 @@ import type {
} from '../../types';
import {
DEBUG, DEBUG_GRAMJS, UPLOAD_WORKERS, IS_TEST,
DEBUG, DEBUG_GRAMJS, UPLOAD_WORKERS, IS_TEST, APP_CODE_NAME,
} from '../../../config';
import {
onRequestPhoneNumber, onRequestCode, onRequestPassword, onRequestRegistration,
@ -42,7 +42,6 @@ import { pause } from '../../../util/schedulers';
const DEFAULT_USER_AGENT = 'Unknown UserAgent';
const DEFAULT_PLATFORM = 'Unknown platform';
const APP_CODE_NAME = 'Z';
GramJsLogger.setLevel(DEBUG_GRAMJS ? 'debug' : 'warn');

View File

@ -1,6 +1,7 @@
import type { ApiLimitType } from './global/types';
export const APP_NAME = process.env.APP_NAME || 'Telegram Web A';
export const APP_CODE_NAME = 'A';
export const APP_NAME = process.env.APP_NAME || `Telegram Web ${APP_CODE_NAME}`;
export const RELEASE_DATETIME = process.env.RELEASE_DATETIME;
export const PRODUCTION_HOSTNAME = 'web.telegram.org';

View File

@ -1,3 +1,4 @@
// Handled by the legacy version. Cannot be updated
const PERMANENT_VERSION_KEY = 'kz_version';
const AVAILABLE_VERSIONS = ['Z', 'K'] as const;

View File

@ -1,5 +1,5 @@
import {
DEBUG, IS_MOCKED_CLIENT, IS_ELECTRON,
DEBUG, IS_MOCKED_CLIENT, IS_ELECTRON, APP_CODE_NAME,
} from '../config';
import { getGlobal } from '../global';
import { hasStoredSession } from './sessions';
@ -8,7 +8,7 @@ const WEBSYNC_URLS = [
't.me',
'telegram.me',
].map((domain) => `https://${domain}/_websync_?`);
const WEBSYNC_VERSION = `${APP_VERSION} Z`;
const WEBSYNC_VERSION = `${APP_VERSION} ${APP_CODE_NAME}`;
const WEBSYNC_KEY = 'tgme_sync';
const WEBSYNC_TIMEOUT = 86400;