diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp index 69ba0f74b5..af4ceec77e 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "core/update_checker.h" +#include "platform/platform_specific.h" #include "base/platform/base_platform_info.h" #include "base/platform/base_platform_file_utilities.h" #include "base/timer.h" @@ -1575,9 +1576,16 @@ void UpdateApplication() { return "https://www.microsoft.com/en-us/store/p/telegram-desktop/9nztwsqntd0s"; #elif defined OS_MAC_STORE // OS_WIN_STORE return "https://itunes.apple.com/ae/app/telegram-desktop/id946399090"; -#else // OS_WIN_STORE || OS_MAC_STORE +#elif defined Q_OS_UNIX && !defined Q_OS_MAC // OS_WIN_STORE || OS_MAC_STORE + if (Platform::InFlatpak()) { + return "https://flathub.org/apps/details/org.telegram.desktop"; + } else if (Platform::InSnap()) { + return "https://snapcraft.io/telegram-desktop"; + } return "https://desktop.telegram.org"; -#endif // OS_WIN_STORE || OS_MAC_STORE +#else // OS_WIN_STORE || OS_MAC_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC) + return "https://desktop.telegram.org"; +#endif // OS_WIN_STORE || OS_MAC_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC) }(); UrlClickHandler::Open(url); } else { diff --git a/Telegram/SourceFiles/mtproto/session_private.cpp b/Telegram/SourceFiles/mtproto/session_private.cpp index b796701f1a..c5598031c2 100644 --- a/Telegram/SourceFiles/mtproto/session_private.cpp +++ b/Telegram/SourceFiles/mtproto/session_private.cpp @@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/mtproto_rpc_sender.h" #include "mtproto/mtproto_dc_options.h" #include "mtproto/connection_abstract.h" +#include "platform/platform_specific.h" #include "base/openssl_help.h" #include "base/qthelp_url.h" #include "base/unixtime.h" @@ -637,9 +638,20 @@ void SessionPrivate::tryToSend() { #elif defined OS_WIN_STORE // OS_MAC_STORE const auto appVersion = QString::fromLatin1(AppVersionStr) + " win store"; -#else // OS_MAC_STORE || OS_WIN_STORE +#elif defined Q_OS_UNIX && !defined Q_OS_MAC // OS_MAC_STORE || OS_WIN_STORE + const auto appVersion = [] { + if (Platform::InFlatpak()) { + return QString::fromLatin1(AppVersionStr) + + " flatpak"; + } else if (Platform::InSnap()) { + return QString::fromLatin1(AppVersionStr) + + " snap"; + } + return QString::fromLatin1(AppVersionStr); + }(); +#else // OS_MAC_STORE || OS_WIN_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC) const auto appVersion = QString::fromLatin1(AppVersionStr); -#endif // OS_MAC_STORE || OS_WIN_STORE +#endif // OS_MAC_STORE || OS_WIN_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC) const auto proxyType = _options->proxy.type; const auto mtprotoProxy = (proxyType == ProxyData::Type::Mtproto); const auto clientProxyFields = mtprotoProxy