ZaStoGram_desktop/Telegram/SourceFiles/config.h
loop-uh 9709fd382a Self-hosted auto-updates via GitHub releases
- Update check and download go to our GitHub releases
  (releases/latest/download) instead of td.telegram.org.
- Disable the MTProto update channel (official Telegram).
- Replace update signing RSA keys with our own.
- CI: build with autoupdate enabled, build Packer, sign update
  packages on tag pushes and publish a proper latest release
  with current4 map; keep dev prereleases for branch pushes.
- CI: bump build cache version to drop a stale object file that
  broke linking, run tag builds on windows-latest.
2026-07-05 13:25:13 +03:00

113 lines
3.4 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "settings.h"
enum {
MaxSelectedItems = 100,
LocalEncryptIterCount = 4000, // key derivation iteration count
LocalEncryptNoPwdIterCount = 4, // key derivation iteration count without pwd (not secure anyway)
LocalEncryptSaltSize = 32, // 256 bit
AutoSearchTimeout = 900, // 0.9 secs
PreloadHeightsCount = 3, // when 3 screens to scroll left make a preload request
SearchPeopleLimit = 5,
WebPageUserId = 701000,
UpdateDelayConstPart = 8 * 3600, // 8 hour min time between update check requests
UpdateDelayRandPart = 8 * 3600, // 8 hour max - min time between update check requests
WrongPasscodeTimeout = 1500,
ChoosePeerByDragTimeout = 1000, // 1 second mouse not moved to choose dialog when dragging a file
};
inline const char *cGUIDStr() {
#ifndef OS_MAC_STORE
static const char *gGuidStr = "{87A94AB0-E370-4cde-98D3-ACC110C5967D}";
#else // OS_MAC_STORE
static const char *gGuidStr = "{E51FB841-8C0B-4EF9-9E9E-5A0078567627}";
#endif // OS_MAC_STORE
return gGuidStr;
}
static const char *UpdatesPublicKey = "\
-----BEGIN RSA PUBLIC KEY-----\n\
MIGJAoGBAMf+sKcUlrZByRknck2hbHM62N62Q2A7gXlaf7EfHjV6tDsGMnOMldUH\n\
fAxohSeFAbuRgqsUgzGnUaDxAnXD59+agTe1P0rtroWXTlSwDLxfrETAeVMl5tJT\n\
S1l+PRoM6ciGcLtylb7i3q8uMWLj32mTeBL2o4wz1IN72H02eFrfAgMBAAE=\n\
-----END RSA PUBLIC KEY-----\
";
static const char *UpdatesPublicBetaKey = "\
-----BEGIN RSA PUBLIC KEY-----\n\
MIGJAoGBANKqDKcjFLmwVP9O6jFnUCYNiIRko5dL8M+mCe/Pa/kaTisXsa2ZGC2m\n\
ET2kQWPRkA2s11cxLBvl5bNFZo3dLu/wAQjsaVoDOFu8fn8Z7EdPbfMFg/woNs/a\n\
1XEwrItBSRHCYtl+tpoP1lZXl0kHS1V6G15iTS3DzrZhua14YVl9AgMBAAE=\n\
-----END RSA PUBLIC KEY-----\
";
#if defined TDESKTOP_API_ID && defined TDESKTOP_API_HASH
constexpr auto ApiId = TDESKTOP_API_ID;
constexpr auto ApiHash = QT_STRINGIFY(TDESKTOP_API_HASH);
#else // TDESKTOP_API_ID && TDESKTOP_API_HASH
// To build your version of Telegram Desktop you're required to provide
// your own 'api_id' and 'api_hash' for the Telegram API access.
//
// How to obtain your 'api_id' and 'api_hash' is described here:
// https://core.telegram.org/api/obtaining_api_id
//
// If you're building the application not for deployment,
// but only for test purposes you can comment out the error below.
//
// This will allow you to use TEST ONLY 'api_id' and 'api_hash' which are
// very limited by the Telegram API server.
//
// Your users will start getting internal server errors on login
// if you deploy an app using those 'api_id' and 'api_hash'.
#error You are required to provide API_ID and API_HASH.
constexpr auto ApiId = 17349;
constexpr auto ApiHash = "344583e45741c457fe1862106095a5eb";
#endif // TDESKTOP_API_ID && TDESKTOP_API_HASH
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
#error "Only little endian is supported!"
#endif // Q_BYTE_ORDER == Q_BIG_ENDIAN
#if (TDESKTOP_ALPHA_VERSION != 0)
// Private key for downloading closed alphas.
#include "../../../DesktopPrivate/alpha_private.h"
#else
static const char *AlphaPrivateKey = "";
#endif
extern QString gKeyFile;
inline const QString &cDataFile() {
if (!gKeyFile.isEmpty()) return gKeyFile;
static const QString res(u"data"_q);
return res;
}
inline const QRegularExpression &cRussianLetters() {
static QRegularExpression regexp(QString::fromUtf8("[а-яА-ЯёЁ]"));
return regexp;
}