From 9033d49d76a2fb81efaf10ebbda8bb5fb910151e Mon Sep 17 00:00:00 2001
From: John Preston <johnprestonmail@gmail.com>
Date: Tue, 21 Jun 2022 00:11:27 +0400
Subject: [PATCH] Version 4.0.

- Premium: Send media and files each up to 4 GB in size.
- Premium: Download media and files at the fastest possible speed,
with no limits.
- Premium: Double most of the limits in the app.
- Premium: Get a new button next to any voice message
to generate a transcript of its audio.
- Premium: React with even more emoji,
including :clown: and :heart_eyes:.
- Premium: Send unique stickers with additional effects,
updated monthly.
- Premium: Set a default chat folder
or enable tools to auto-archive and hide new chats.
- Premium: Subscribers have a badge next to their name,
showing they help support Telegram.
- Premium: Show off your profile video
that will be animated for everyone in chats and the chat list.
- Premium: Sponsored Messages that are sometimes shown
in public channels will no longer appear.
- Enable join requests for your public groups,
no invite links required.
- Users who open the group will see an Apply to Join Group button.
- Once approved by an admin,
users will be able to participate in the chat.
- Bots that are integrated into the attachment menu
can be programmed to work in groups and channels.
---
 Telegram/Resources/uwp/AppX/AppxManifest.xml    |  2 +-
 Telegram/Resources/winrc/Telegram.rc            |  8 ++++----
 Telegram/Resources/winrc/Updater.rc             |  8 ++++----
 Telegram/SourceFiles/core/version.h             |  6 +++---
 .../payments/payments_checkout_process.h        |  2 +-
 Telegram/build/version                          | 12 ++++++------
 Telegram/lib_ui                                 |  2 +-
 changelog.txt                                   | 17 +++++++++++++++++
 8 files changed, 37 insertions(+), 20 deletions(-)

diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml
index 9d2f337505..bdf4c5656c 100644
--- a/Telegram/Resources/uwp/AppX/AppxManifest.xml
+++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml
@@ -10,7 +10,7 @@
   <Identity Name="TelegramMessengerLLP.TelegramDesktop"
     ProcessorArchitecture="ARCHITECTURE"
     Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
-    Version="3.7.6.0" />
+    Version="4.0.0.0" />
   <Properties>
     <DisplayName>Telegram Desktop</DisplayName>
     <PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc
index 8baa9d79e7..d41b3748da 100644
--- a/Telegram/Resources/winrc/Telegram.rc
+++ b/Telegram/Resources/winrc/Telegram.rc
@@ -44,8 +44,8 @@ IDI_ICON1               ICON                    "..\\art\\icon256.ico"
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 3,7,6,0
- PRODUCTVERSION 3,7,6,0
+ FILEVERSION 4,0,0,0
+ PRODUCTVERSION 4,0,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -62,10 +62,10 @@ BEGIN
         BEGIN
             VALUE "CompanyName", "Telegram FZ-LLC"
             VALUE "FileDescription", "Telegram Desktop"
-            VALUE "FileVersion", "3.7.6.0"
+            VALUE "FileVersion", "4.0.0.0"
             VALUE "LegalCopyright", "Copyright (C) 2014-2022"
             VALUE "ProductName", "Telegram Desktop"
-            VALUE "ProductVersion", "3.7.6.0"
+            VALUE "ProductVersion", "4.0.0.0"
         END
     END
     BLOCK "VarFileInfo"
diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc
index f965b5883a..ffdeb52f41 100644
--- a/Telegram/Resources/winrc/Updater.rc
+++ b/Telegram/Resources/winrc/Updater.rc
@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 3,7,6,0
- PRODUCTVERSION 3,7,6,0
+ FILEVERSION 4,0,0,0
+ PRODUCTVERSION 4,0,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -53,10 +53,10 @@ BEGIN
         BEGIN
             VALUE "CompanyName", "Telegram FZ-LLC"
             VALUE "FileDescription", "Telegram Desktop Updater"
-            VALUE "FileVersion", "3.7.6.0"
+            VALUE "FileVersion", "4.0.0.0"
             VALUE "LegalCopyright", "Copyright (C) 2014-2022"
             VALUE "ProductName", "Telegram Desktop"
-            VALUE "ProductVersion", "3.7.6.0"
+            VALUE "ProductVersion", "4.0.0.0"
         END
     END
     BLOCK "VarFileInfo"
diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h
index c8467a51f8..152e240d40 100644
--- a/Telegram/SourceFiles/core/version.h
+++ b/Telegram/SourceFiles/core/version.h
@@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs;
 constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
 constexpr auto AppName = "Telegram Desktop"_cs;
 constexpr auto AppFile = "Telegram"_cs;
-constexpr auto AppVersion = 3007006;
-constexpr auto AppVersionStr = "3.7.6";
-constexpr auto AppBetaVersion = true;
+constexpr auto AppVersion = 4000000;
+constexpr auto AppVersionStr = "4.0";
+constexpr auto AppBetaVersion = false;
 constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
diff --git a/Telegram/SourceFiles/payments/payments_checkout_process.h b/Telegram/SourceFiles/payments/payments_checkout_process.h
index aaa8055103..9ad90c4062 100644
--- a/Telegram/SourceFiles/payments/payments_checkout_process.h
+++ b/Telegram/SourceFiles/payments/payments_checkout_process.h
@@ -147,7 +147,7 @@ private:
 		Ui::UncheckedCardDetails data,
 		bool saveInformation) override;
 	void panelShowBox(object_ptr<Ui::BoxContent> box) override;
-	QVariant panelClickHandlerContext();
+	QVariant panelClickHandlerContext() override;
 
 	QString panelWebviewDataPath() override;
 
diff --git a/Telegram/build/version b/Telegram/build/version
index bd71575797..7f005d0acf 100644
--- a/Telegram/build/version
+++ b/Telegram/build/version
@@ -1,7 +1,7 @@
-AppVersion         3007006
-AppVersionStrMajor 3.7
-AppVersionStrSmall 3.7.6
-AppVersionStr      3.7.6
-BetaChannel        1
+AppVersion         4000000
+AppVersionStrMajor 4.0
+AppVersionStrSmall 4.0
+AppVersionStr      4.0.0
+BetaChannel        0
 AlphaVersion       0
-AppVersionOriginal 3.7.6.beta
+AppVersionOriginal 4.0
diff --git a/Telegram/lib_ui b/Telegram/lib_ui
index 8de2eee8cc..8e0f928205 160000
--- a/Telegram/lib_ui
+++ b/Telegram/lib_ui
@@ -1 +1 @@
-Subproject commit 8de2eee8cc728d19be06cc0a6e9e35496fefc732
+Subproject commit 8e0f9282056f418145b53c2d99e695e48775816c
diff --git a/changelog.txt b/changelog.txt
index 57af4769d8..2c44ff360e 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,20 @@
+4.0 (22.06.22)
+
+- Premium: Send media and files each up to 4 GB in size.
+- Premium: Download media and files at the fastest possible speed, with no limits.
+- Premium: Double most of the limits in the app.
+- Premium: Get a new button next to any voice message to generate a transcript of its audio.
+- Premium: React with even more emoji, including :clown: and :heart_eyes:.
+- Premium: Send unique stickers with additional effects, updated monthly.
+- Premium: Set a default chat folder or enable tools to auto-archive and hide new chats.
+- Premium: Subscribers have a badge next to their name, showing they help support Telegram.
+- Premium: Show off your profile video that will be animated for everyone in chats and the chat list.
+- Premium: Sponsored Messages that are sometimes shown in public channels will no longer appear.
+- Enable join requests for your public groups – no invite links required.
+- Users who open the group will see an Apply to Join Group button.
+- Once approved by an admin, users will be able to participate in the chat.
+- Bots that are integrated into the attachment menu can be programmed to work in groups and channels.
+
 3.7.6 beta (16.06.22)
 
 - Settings > Advanced > Experimental adds an option to open chats in separate windows.