diff --git a/Telegram/SourceFiles/boxes/about_box.cpp b/Telegram/SourceFiles/boxes/about_box.cpp index a0415b354..7b1e0878f 100644 --- a/Telegram/SourceFiles/boxes/about_box.cpp +++ b/Telegram/SourceFiles/boxes/about_box.cpp @@ -105,6 +105,7 @@ void AboutBox::resizeEvent(QResizeEvent *e) { } void AboutBox::showVersionHistory() { + /* if (cRealAlphaVersion()) { auto url = qsl("https://tdesktop.com/"); if (Platform::IsWindows32Bit()) { @@ -128,8 +129,11 @@ void AboutBox::showVersionHistory() { Ui::show(Box("The link to the current private alpha version of Telegram Desktop was copied to the clipboard.")); } else { + */ UrlClickHandler::Open(Core::App().changelogLink()); + /* } + */ } void AboutBox::keyPressEvent(QKeyEvent *e) { @@ -160,7 +164,7 @@ QString telegramFaqLink() { QString currentVersionText() { auto result = QString::fromLatin1(AppKotatoVersionStr); if (cAlphaVersion()) { - result += qsl(" alpha %1").arg(cAlphaVersion() % 1000); + result += qsl("-%1.%2").arg(AppKotatoTestBranch).arg(cAlphaVersion() % 1000); } else if (AppBetaVersion) { result += " beta"; } diff --git a/Telegram/SourceFiles/boxes/confirm_phone_box.cpp b/Telegram/SourceFiles/boxes/confirm_phone_box.cpp index e0d4bf803..306442119 100644 --- a/Telegram/SourceFiles/boxes/confirm_phone_box.cpp +++ b/Telegram/SourceFiles/boxes/confirm_phone_box.cpp @@ -31,7 +31,7 @@ object_ptr CurrentConfirmPhoneBox = { nullptr }; void SendToBannedHelp(const QString &phone) { const auto version = QString::fromLatin1(AppVersionStr) + (cAlphaVersion() - ? qsl(" alpha %1").arg(cAlphaVersion()) + ? qsl("-%1.%2").arg(AppKotatoTestBranch).arg(cAlphaVersion() % 1000) : (AppBetaVersion ? " beta" : "")); const auto subject = qsl("Banned phone number: ") + phone; diff --git a/Telegram/SourceFiles/core/crash_report_window.cpp b/Telegram/SourceFiles/core/crash_report_window.cpp index 0f244c45a..4db1764fa 100644 --- a/Telegram/SourceFiles/core/crash_report_window.cpp +++ b/Telegram/SourceFiles/core/crash_report_window.cpp @@ -439,7 +439,7 @@ QString LastCrashedWindow::getReportField(const QLatin1String &name, const QLati QString data = lines.at(i).trimmed().mid(prefix.size()).trimmed(); if (name == qstr("version")) { - if (data.endsWith(qstr(" alpha"))) { + if (data.endsWith(qstr(" %1").arg(AppKotatoTestBranch))) { data = QString::number(-data.replace(QRegularExpression(qsl("[^\\d]")), "").toLongLong()); } else { data = QString::number(data.replace(QRegularExpression(qsl("[^\\d]")), "").toLongLong()); diff --git a/Telegram/SourceFiles/core/crash_reports.cpp b/Telegram/SourceFiles/core/crash_reports.cpp index 06ec930ce..44bf3ce73 100644 --- a/Telegram/SourceFiles/core/crash_reports.cpp +++ b/Telegram/SourceFiles/core/crash_reports.cpp @@ -346,7 +346,7 @@ void StartCatching(not_null launcher) { #ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS ProcessAnnotations["Binary"] = cExeName().toUtf8().constData(); ProcessAnnotations["ApiId"] = QString::number(cApiId()).toUtf8().constData(); - ProcessAnnotations["Version"] = (cAlphaVersion() ? qsl("%1 alpha").arg(cAlphaVersion()) : (AppBetaVersion ? qsl("%1 beta") : qsl("%1")).arg(AppKotatoVersion)).toUtf8().constData(); + ProcessAnnotations["Version"] = (cAlphaVersion() ? qsl("%1 %2").arg(cAlphaVersion()).arg(AppKotatoTestBranch) : (AppBetaVersion ? qsl("%1 beta") : qsl("%1")).arg(AppKotatoVersion)).toUtf8().constData(); ProcessAnnotations["Launched"] = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss").toUtf8().constData(); ProcessAnnotations["Platform"] = PlatformString().toUtf8().constData(); ProcessAnnotations["UserTag"] = QString::number(launcher->installationTag(), 16).toUtf8().constData(); diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp index 927cb927d..2ceb8e8e5 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp @@ -518,7 +518,7 @@ bool ParseCommonMap( const auto types = (*it).toObject(); const auto list = [&]() -> std::vector { if (cAlphaVersion()) { - return { "alpha", "beta", "stable" }; + return { AppKotatoTestBranch }; } else if (cInstallBetaVersion()) { return { "beta", "stable" }; } @@ -541,7 +541,7 @@ bool ParseCommonMap( if (version == map.constEnd()) { continue; } - const auto isAvailableAlpha = (type == "alpha"); + const auto isAvailableAlpha = (type == AppKotatoTestBranch); const auto availableVersion = [&] { if ((*version).isString()) { const auto string = (*version).toString(); @@ -1493,7 +1493,7 @@ bool checkReadyUpdate() { return false; } if (!cAlphaVersion() || alphaVersion <= cAlphaVersion()) { - LOG(("Update Error: cant install alpha version %1 having alpha version %2").arg(alphaVersion).arg(cAlphaVersion())); + LOG(("Update Error: cant install alpha version %1 having %2 version %3").arg(alphaVersion).arg(AppKotatoTestBranch).arg(cAlphaVersion())); ClearAll(); return false; } diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index c7f0d1af3..a5ba7e0d2 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL //#include "base/const_string.h" #include "kotato/version.h" +/* #define TDESKTOP_REQUESTED_ALPHA_VERSION (0ULL) #ifdef TDESKTOP_ALLOW_CLOSED_ALPHA @@ -18,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #else // TDESKTOP_ALLOW_CLOSED_ALPHA #define TDESKTOP_ALPHA_VERSION (0ULL) #endif // TDESKTOP_ALLOW_CLOSED_ALPHA +*/ // used in Updater.cpp and Setup.iss for Windows //constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs; diff --git a/Telegram/SourceFiles/kotato/version.h b/Telegram/SourceFiles/kotato/version.h index 5b5f885fc..aa152539e 100644 --- a/Telegram/SourceFiles/kotato/version.h +++ b/Telegram/SourceFiles/kotato/version.h @@ -15,3 +15,14 @@ constexpr auto AppFile = "Kotatogram"_cs; constexpr auto AppKotatoVersion = 1004000; constexpr auto AppKotatoVersionStr = "1.4"; constexpr auto AppBetaVersion = false; + +// Test branch related +constexpr auto AppKotatoTestBranch = "dev"; + +#define TDESKTOP_REQUESTED_ALPHA_VERSION (0ULL) + +#ifdef TDESKTOP_ALLOW_CLOSED_ALPHA +#define TDESKTOP_ALPHA_VERSION TDESKTOP_REQUESTED_ALPHA_VERSION +#else // TDESKTOP_ALLOW_CLOSED_ALPHA +#define TDESKTOP_ALPHA_VERSION (0ULL) +#endif // TDESKTOP_ALLOW_CLOSED_ALPHA diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 9941ab5ff..114d95837 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -414,9 +414,10 @@ void start(not_null launcher) { LogsData = nullptr; } - LOG(("Launched version: %1, install beta: %2, alpha: %3, debug mode: %4" + LOG(("Launched version: %1, install beta: %2, %3: %4, debug mode: %5" ).arg(AppVersion ).arg(Logs::b(cInstallBetaVersion()) + ).arg(AppKotatoTestBranch ).arg(cAlphaVersion() ).arg(Logs::b(DebugEnabled()))); LOG(("Executable dir: %1, name: %2").arg(cExeDir(), cExeName())); diff --git a/Telegram/SourceFiles/mtproto/session_private.cpp b/Telegram/SourceFiles/mtproto/session_private.cpp index 4f525677f..29b869759 100644 --- a/Telegram/SourceFiles/mtproto/session_private.cpp +++ b/Telegram/SourceFiles/mtproto/session_private.cpp @@ -98,7 +98,9 @@ using namespace details; #else // OS_MAC_STORE || OS_WIN_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC) return Platform::IsWindows64Bit() ? u" x64"_q : QString(); #endif // OS_MAC_STORE || OS_WIN_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC) - })() + qsl(" (TD %1)").arg(AppVersionStr); + })() + (cAlphaVersion() + ? (qsl("-%1.%2").arg(AppKotatoTestBranch).arg(cAlphaVersion() % 1000)) + : QString()); } void WrapInvokeAfter( diff --git a/Telegram/cmake/telegram_options.cmake b/Telegram/cmake/telegram_options.cmake index 4b62504f3..3cd3b5c44 100644 --- a/Telegram/cmake/telegram_options.cmake +++ b/Telegram/cmake/telegram_options.cmake @@ -25,9 +25,9 @@ if (DESKTOP_APP_DISABLE_AUTOUPDATE) target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_AUTOUPDATE) endif() -# if (DESKTOP_APP_SPECIAL_TARGET) -# target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA) -# endif() +if (DESKTOP_APP_SPECIAL_TARGET) + target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA) +endif() if (NOT TDESKTOP_LAUNCHER_BASENAME) set(TDESKTOP_LAUNCHER_BASENAME "kotatogramdesktop")