From 8cbeadc68a88acb207305ad02e6c01df3a80b690 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 2 Jul 2024 13:22:33 +0400 Subject: [PATCH] Register tg:// scheme on initial launch. --- Telegram/SourceFiles/core/application.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index 21d3aa7ca..c33b24c2a 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -261,9 +261,14 @@ void Application::run() { refreshGlobalProxy(); // Depends on app settings being read. - if (const auto old = Local::oldSettingsVersion(); old < AppVersion) { + if (const auto old = Local::oldSettingsVersion()) { + if (old < AppVersion) { + InvokeQueued(this, [] { RegisterUrlScheme(); }); + Platform::NewVersionLaunched(old); + } + } else { + // Initial launch. InvokeQueued(this, [] { RegisterUrlScheme(); }); - Platform::NewVersionLaunched(old); } if (cAutoStart() && !Platform::AutostartSupported()) {