From 9efe16b6b47ba3fc3a2b12095bb98488d3f07259 Mon Sep 17 00:00:00 2001
From: John Preston <johnprestonmail@gmail.com>
Date: Fri, 2 Jan 2015 18:20:23 +0300
Subject: [PATCH] 0.7.5 almost ready

---
 Telegram/PrepareWin.bat                     |   6 +++---
 Telegram/Resources/lang.strings             |   2 +-
 Telegram/SourceFiles/application.cpp        |   6 +++---
 Telegram/SourceFiles/config.h               |   4 ++--
 Telegram/SourceFiles/lang.h                 |   1 +
 Telegram/SourceFiles/telegram.qrc           |   1 +
 Telegram/SourceFiles/telegram_linux.qrc     |   1 +
 Telegram/Telegram.plist                     |   2 +-
 Telegram/Telegram.pro                       |  11 ++++++-----
 Telegram/Telegram.rc                        | Bin 5532 -> 5532 bytes
 Telegram/Telegram.vcxproj                   |   1 +
 Telegram/Telegram.vcxproj.filters           |   3 +++
 Telegram/Telegram.xcodeproj/project.pbxproj |  12 ++++++------
 Telegram/Version.sh                         |   2 +-
 14 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/Telegram/PrepareWin.bat b/Telegram/PrepareWin.bat
index ab6ff8d5e..222933feb 100644
--- a/Telegram/PrepareWin.bat
+++ b/Telegram/PrepareWin.bat
@@ -1,8 +1,8 @@
 @echo OFF
 
-set "AppVersionStrSmall=0.7.4"
-set "AppVersionStr=0.7.4"
-set "AppVersionStrFull=0.7.4.0"
+set "AppVersionStrSmall=0.7.5"
+set "AppVersionStr=0.7.5"
+set "AppVersionStrFull=0.7.5.0"
 
 echo.
 echo Preparing version %AppVersionStr%..
diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings
index 971a3d7f2..333c36d04 100644
--- a/Telegram/Resources/lang.strings
+++ b/Telegram/Resources/lang.strings
@@ -449,7 +449,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org
 
 "lng_new_authorization" = "{name},\nWe detected a login into your account from a new device on {day}, {date} at {time}\n\nDevice: {device}\nLocation: {location}\n\nIf this wasn't you, you can go to Settings — Terminate other sessions.\n\nThanks,\nThe Telegram Team";
 
-"lng_new_version7004" = "Telegram Desktop was updated to version {version}\n\n — German and Dutch languages added.\n\nFull version history is available here:\n{link}";
+"lng_new_version7005" = "Telegram Desktop was updated to version {version}\n\n — Stickers support\n — Local caching for voice messages\n — Added Portuguese language\n\nFull version history is available here:\n{link}";
 
 // Mac specific
 
diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp
index 1307463b4..3a28d2489 100644
--- a/Telegram/SourceFiles/application.cpp
+++ b/Telegram/SourceFiles/application.cpp
@@ -697,8 +697,8 @@ void Application::startApp() {
 	QNetworkProxyFactory::setUseSystemConfiguration(true);
 	if (Local::oldMapVersion() < AppVersion) {
 		psRegisterCustomScheme();
-		if (Local::oldMapVersion() && Local::oldMapVersion() < 7004) {
-			QString versionFeatures(lng_new_version7004(lt_version, QString::fromStdWString(AppVersionStr), lt_link, qsl("https://desktop.telegram.org/#changelog")));
+		if (Local::oldMapVersion() && Local::oldMapVersion() < 7005) {
+			QString versionFeatures(lng_new_version7005(lt_version, QString::fromStdWString(AppVersionStr), lt_link, qsl("https://desktop.telegram.org/#changelog")));
 			if (!versionFeatures.isEmpty()) {
 				window->serviceNotification(versionFeatures);
 			}
@@ -855,7 +855,7 @@ QString Application::language() {
 int32 Application::languageId() {
 	QByteArray l = language().toLatin1();
 	for (int32 i = 0; i < languageCount; ++i) {
-		if (l == LanguageCodes[i]) {
+		if (l.at(0) == LanguageCodes[i][0] && l.at(1) == LanguageCodes[i][1]) {
 			return i;
 		}
 	}
diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h
index 00df28ee4..2a87f5e17 100644
--- a/Telegram/SourceFiles/config.h
+++ b/Telegram/SourceFiles/config.h
@@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org
 */
 #pragma once
 
-static const int32 AppVersion = 7004;
-static const wchar_t *AppVersionStr = L"0.7.4";
+static const int32 AppVersion = 7005;
+static const wchar_t *AppVersionStr = L"0.7.5";
 
 static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
 static const wchar_t *AppName = L"Telegram Desktop";
diff --git a/Telegram/SourceFiles/lang.h b/Telegram/SourceFiles/lang.h
index 04ff52c35..259a43827 100644
--- a/Telegram/SourceFiles/lang.h
+++ b/Telegram/SourceFiles/lang.h
@@ -23,6 +23,7 @@ static const char *LanguageCodes[] = {
 	"es",
 	"de",
 	"nl",
+	"pt_BR",
 };
 static const int languageTest = -1, languageDefault = 0, languageCount = sizeof(LanguageCodes) / sizeof(LanguageCodes[0]);
 
diff --git a/Telegram/SourceFiles/telegram.qrc b/Telegram/SourceFiles/telegram.qrc
index e62c014fb..123a3c6ef 100644
--- a/Telegram/SourceFiles/telegram.qrc
+++ b/Telegram/SourceFiles/telegram.qrc
@@ -46,5 +46,6 @@
     <file alias="lang_es.strings">langs/lang_es.strings</file>
     <file alias="lang_de.strings">langs/lang_de.strings</file>
     <file alias="lang_nl.strings">langs/lang_nl.strings</file>
+    <file alias="lang_pt_BR.strings">langs/lang_pt_BR.strings</file>
   </qresource>
 </RCC>
diff --git a/Telegram/SourceFiles/telegram_linux.qrc b/Telegram/SourceFiles/telegram_linux.qrc
index 8191ab0ba..2422e35d8 100644
--- a/Telegram/SourceFiles/telegram_linux.qrc
+++ b/Telegram/SourceFiles/telegram_linux.qrc
@@ -46,5 +46,6 @@
         <file alias="lang_es.strings">langs/lang_es.strings</file>
         <file alias="lang_de.strings">langs/lang_de.strings</file>
         <file alias="lang_nl.strings">langs/lang_nl.strings</file>
+        <file alias="lang_pt_BR.strings">langs/lang_pt_BR.strings</file>
     </qresource>
 </RCC>
diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist
index e161e39ae..2d00fcaab 100644
--- a/Telegram/Telegram.plist
+++ b/Telegram/Telegram.plist
@@ -11,7 +11,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>0.7.4</string>
+	<string>0.7.5</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleURLTypes</key>
diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro
index 1e9ad8162..1b0005f24 100644
--- a/Telegram/Telegram.pro
+++ b/Telegram/Telegram.pro
@@ -279,8 +279,9 @@ RESOURCES += \
 OTHER_FILES += \
     Resources/style_classes.txt \
     Resources/style.txt \
-    Resources/lang.strings
-    SourceFiles/langs/lang_it.strings
-    SourceFiles/langs/lang_es.strings
-    SourceFiles/langs/lang_de.strings
-    SourceFiles/langs/lang_nl.strings
+    Resources/lang.strings \
+    SourceFiles/langs/lang_it.strings \
+    SourceFiles/langs/lang_es.strings \
+    SourceFiles/langs/lang_de.strings \
+    SourceFiles/langs/lang_nl.strings \
+    SourceFiles/langs/lang_pt_BR.strings
diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc
index 9dd3f70cf8b58baaa6c84a15ee5108a98c2b2b98..1e7efd6de99667ff5ee1276e244038a5cc2945cc 100644
GIT binary patch
delta 50
zcmbQEJx6;(0WYKJ<U(FUR#OHY27}2Tc_lX=;4NYT3g!z+Pj28B+ngf6#mH#7IbTqh
F1ps(Q4bT7p

delta 50
zcmbQEJx6;(0WYJ;<U(FURucvt27}2Tc_lX=;4NYT3g!z+Pj28B+ngf6#mH!~IbTqh
F1ps&64a@)l

diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj
index 4fd78b1a5..d463ad7cd 100644
--- a/Telegram/Telegram.vcxproj
+++ b/Telegram/Telegram.vcxproj
@@ -1781,6 +1781,7 @@
     <None Include="SourceFiles\langs\lang_es.strings" />
     <None Include="SourceFiles\langs\lang_it.strings" />
     <None Include="SourceFiles\langs\lang_nl.strings" />
+    <None Include="SourceFiles\langs\lang_pt_BR.strings" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters
index 848c332f5..3883b3576 100644
--- a/Telegram/Telegram.vcxproj.filters
+++ b/Telegram/Telegram.vcxproj.filters
@@ -1057,5 +1057,8 @@
     <None Include="SourceFiles\langs\lang_nl.strings">
       <Filter>langs</Filter>
     </None>
+    <None Include="SourceFiles\langs\lang_pt_BR.strings">
+      <Filter>langs</Filter>
+    </None>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj
index 0a93f7c21..6cc124433 100644
--- a/Telegram/Telegram.xcodeproj/project.pbxproj
+++ b/Telegram/Telegram.xcodeproj/project.pbxproj
@@ -1595,7 +1595,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 0.7.4;
+				CURRENT_PROJECT_VERSION = 0.7.5;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
@@ -1613,7 +1613,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 0.7.4;
+				CURRENT_PROJECT_VERSION = 0.7.5;
 				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
 				GCC_OPTIMIZATION_LEVEL = fast;
 				GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h;
@@ -1639,10 +1639,10 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				CODE_SIGN_IDENTITY = "";
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 0.7.4;
+				CURRENT_PROJECT_VERSION = 0.7.5;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DYLIB_COMPATIBILITY_VERSION = 0.7;
-				DYLIB_CURRENT_VERSION = 0.7.4;
+				DYLIB_CURRENT_VERSION = 0.7.5;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				FRAMEWORK_SEARCH_PATHS = "";
 				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
@@ -1782,10 +1782,10 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				CODE_SIGN_IDENTITY = "";
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 0.7.4;
+				CURRENT_PROJECT_VERSION = 0.7.5;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DYLIB_COMPATIBILITY_VERSION = 0.7;
-				DYLIB_CURRENT_VERSION = 0.7.4;
+				DYLIB_CURRENT_VERSION = 0.7.5;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				FRAMEWORK_SEARCH_PATHS = "";
 				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
diff --git a/Telegram/Version.sh b/Telegram/Version.sh
index 58276c474..b4d68733b 100755
--- a/Telegram/Version.sh
+++ b/Telegram/Version.sh
@@ -1,2 +1,2 @@
-echo 7004 0.7.4
+echo 7005 0.7.5