| 1877 | } |
| 1878 | |
| 1879 | void UpdateApplication() { |
| 1880 | if (UpdaterDisabled()) { |
| 1881 | const auto url = [&] { |
| 1882 | #ifdef OS_WIN_STORE |
| 1883 | return "https://www.microsoft.com/en-us/store/p/telegram-desktop/9nztwsqntd0s"; |
| 1884 | #elif defined OS_MAC_STORE // OS_WIN_STORE |
| 1885 | return "https://itunes.apple.com/ae/app/telegram-desktop/id946399090"; |
| 1886 | #else // OS_WIN_STORE || OS_MAC_STORE |
| 1887 | if (KSandbox::isFlatpak()) { |
| 1888 | return "https://flathub.org/apps/details/io.github.tdesktop_x64.TDesktop"; |
| 1889 | } else if (KSandbox::isSnap()) { |
| 1890 | return "https://snapcraft.io/telegram-desktop"; |
| 1891 | } |
| 1892 | return "https://desktop.telegram.org"; |
| 1893 | #endif // OS_WIN_STORE || OS_MAC_STORE |
| 1894 | }(); |
| 1895 | UrlClickHandler::Open(url); |
| 1896 | } else { |
| 1897 | cSetAutoUpdate(true); |
| 1898 | const auto window = Core::IsAppLaunched() |
| 1899 | ? Core::App().activePrimaryWindow() |
| 1900 | : nullptr; |
| 1901 | if (window) { |
| 1902 | if (const auto controller = window->sessionController()) { |
| 1903 | controller->showSection( |
| 1904 | std::make_shared<Info::Memento>( |
| 1905 | Info::Settings::Tag{ controller->session().user() }, |
| 1906 | ::Settings::AdvancedId()), |
| 1907 | Window::SectionShow()); |
| 1908 | } else { |
| 1909 | window->widget()->showSpecialLayer( |
| 1910 | Box<::Settings::LayerWidget>(window), |
| 1911 | anim::type::normal); |
| 1912 | } |
| 1913 | window->widget()->showFromTray(); |
| 1914 | } |
| 1915 | cSetLastUpdateCheck(0); |
| 1916 | Core::UpdateChecker().start(); |
| 1917 | } |
| 1918 | } |
| 1919 | |
| 1920 | QString countAlphaVersionSignature(uint64 version) { // duplicated in packer.cpp |
| 1921 | if (cAlphaPrivateKey().isEmpty()) { |
no test coverage detected