From 635cae4f942c8dfff547dc7169fb370c6a6551e2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 1 Jun 2015 23:24:09 +0300 Subject: [PATCH] version 0.8.19 with fixed stickerpacks and voice messages changelog --- MSVC.md | 4 ++++ Telegram/PrepareWin.bat | 8 ++++---- Telegram/Resources/lang.strings | 2 +- Telegram/SourceFiles/app.cpp | 1 - Telegram/SourceFiles/application.cpp | 4 ++-- Telegram/SourceFiles/config.h | 4 ++-- Telegram/SourceFiles/dropdown.cpp | 7 ------- Telegram/SourceFiles/historywidget.cpp | 7 ------- Telegram/SourceFiles/localstorage.cpp | 21 ++++++++------------ Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | Bin 5540 -> 5540 bytes Telegram/Telegram.xcodeproj/project.pbxproj | 12 +++++------ Telegram/Version.sh | 2 +- 13 files changed, 29 insertions(+), 45 deletions(-) diff --git a/MSVC.md b/MSVC.md index 8fd8cdcf40..cb4eb8db52 100644 --- a/MSVC.md +++ b/MSVC.md @@ -111,6 +111,8 @@ http://msys2.github.io/ > Download [msys2-x86_64-20150512.exe](http://sourceforg #####Building libraries +Download [yasm for Win64](http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe) from http://yasm.tortall.net/Download.html, rename **yasm-1.3.0-win64.exe** to **yasm.exe** and place it to your Visual C++ **bin** directory, like **\\Program Files (x86)\\Microsoft Visual Studio 12\\VC\\bin\\** + Open **VS2013 x86 Native Tools Command Prompt.bat** (should be in **\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\Shortcuts\\** folder), go to **D:\\msys64\\** and launch **msys2_shell.bat**, there run PATH="/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/BIN:$PATH" @@ -119,6 +121,8 @@ Open **VS2013 x86 Native Tools Command Prompt.bat** (should be in **\\Program Fi pacman -S msys/make pacman -S mingw64/mingw-w64-x86_64-opus + PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH" + ./configure --toolchain=msvc --disable-programs --disable-everything --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-parser=aac --enable-parser=aac_latm --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=wav --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=mov --enable-muxer=ogg --enable-muxer=opus --extra-ldflags="-libpath:/d/TBuild/Libraries/opus/win32/VS2010/Win32/Release celt.lib silk_common.lib silk_float.lib" make diff --git a/Telegram/PrepareWin.bat b/Telegram/PrepareWin.bat index 1c46b32958..e93a05e514 100644 --- a/Telegram/PrepareWin.bat +++ b/Telegram/PrepareWin.bat @@ -1,9 +1,9 @@ @echo OFF -set "AppVersion=8018" -set "AppVersionStrSmall=0.8.18" -set "AppVersionStr=0.8.18" -set "AppVersionStrFull=0.8.18.0" +set "AppVersion=8019" +set "AppVersionStrSmall=0.8.19" +set "AppVersionStr=0.8.19" +set "AppVersionStrFull=0.8.19.0" set "DevChannel=1" if %DevChannel% neq 0 goto preparedev diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 138e264ebe..d534ef92a8 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -585,7 +585,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop was updated to version {version}\n\n{changes}\n\nFull version history is available here:\n{link}"; "lng_new_version_minor" = "— Bug fixes and other minor improvements"; -"lng_new_version_text" = "— Added support for sticker packs\n— New emoji and sticker panel"; +"lng_new_version_text" = "— Added sending voice messages\n— Fixed disappearing stickers"; "lng_menu_insert_unicode" = "Insert Unicode control character"; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 137ece6baf..6924764198 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1543,7 +1543,6 @@ namespace App { cSetStickerSets(StickerSets()); cSetStickerSetsOrder(StickerSetsOrder()); cSetLastStickersUpdate(0); - LOG(("Stickers: cleared everything!")); ::videoItems.clear(); ::audioItems.clear(); ::documentItems.clear(); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 45cde3892a..468d4016ed 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -662,8 +662,8 @@ void Application::checkMapVersion() { psRegisterCustomScheme(); if (Local::oldMapVersion()) { QString versionFeatures; - if (DevChannel && Local::oldMapVersion() < 8015) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Video captions are displayed\n\xe2\x80\x94 Photo captions are displayed in photo viewer\n\xe2\x80\x94 Round corners for messages").replace('@', qsl("@") + QChar(0x200D)); + if (DevChannel && Local::oldMapVersion() < 8019) { + versionFeatures = lang(lng_new_version_text).trimmed();// QString::fromUtf8("\xe2\x80\x94 Video captions are displayed\n\xe2\x80\x94 Photo captions are displayed in photo viewer\n\xe2\x80\x94 Round corners for messages").replace('@', qsl("@") + QChar(0x200D)); } else if (!DevChannel && Local::oldMapVersion() < 8016) { versionFeatures = lang(lng_new_version_text).trimmed(); } else if (!DevChannel && Local::oldMapVersion() < 8017) { diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 1ffc43f1b8..2089732c4d 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 = 8018; -static const wchar_t *AppVersionStr = L"0.8.18"; +static const int32 AppVersion = 8019; +static const wchar_t *AppVersionStr = L"0.8.19"; static const bool DevChannel = true; static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 7b6e216d82..9202ea116c 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -1384,8 +1384,6 @@ void StickerPanInner::refreshStickers() { _hovers.clear(); _hovers.reserve(sets.size() + 1); _titles.clear(); _titles.reserve(sets.size() + 1); - LOG(("Stickers: refreshing pan, sets size: %1").arg(sets.size())); - refreshRecent(false); appendSet(CustomStickerSetId); @@ -1431,12 +1429,10 @@ void StickerPanInner::preloadImages() { } void StickerPanInner::appendSet(uint64 setId) { - LOG(("Stickers: appending set %1..").arg(setId)); const StickerSets &sets(cStickerSets()); StickerSets::const_iterator it = sets.constFind(setId); if (it == sets.cend() || it->stickers.isEmpty()) return; - LOG(("Stickers: set %1 found! %2 stickers there.").arg(setId).arg(it->stickers.size())); StickerPack pack; pack.reserve(it->stickers.size()); for (int32 i = 0, l = it->stickers.size(); i < l; ++i) { @@ -1452,7 +1448,6 @@ void StickerPanInner::appendSet(uint64 setId) { void StickerPanInner::refreshRecent(bool performResize) { clearSelection(true); if (cGetRecentStickers().isEmpty()) { - LOG(("Stickers: no recent!")); if (!_setIds.isEmpty() && _setIds.at(0) == RecentStickerSetId) { _setIds.pop_front(); _sets.pop_front(); @@ -1460,7 +1455,6 @@ void StickerPanInner::refreshRecent(bool performResize) { _titles.pop_front(); } } else { - LOG(("Stickers: %1 recent stickers!").arg(cGetRecentStickers().size())); StickerPack recent; recent.reserve(cGetRecentStickers().size()); for (int32 i = 0, l = cGetRecentStickers().size(); i < l; ++i) { @@ -2050,7 +2044,6 @@ void EmojiPan::onRemoveSetSure() { ++i; } } - LOG(("Stickers: removed one set, %1.").arg(_removingSetId)); cRefStickerSets().erase(it); cRefStickerSetsOrder().removeOne(_removingSetId); cSetStickersHash(QByteArray()); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 475e06911e..288e6c5a7e 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -1851,8 +1851,6 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { cSetLastStickersUpdate(getms(true)); _stickersUpdateRequest = 0; - LOG(("Stickers: got from server!")); - if (stickers.type() != mtpc_messages_allStickers) return; const MTPDmessages_allStickers &d(stickers.c_messages_allStickers()); @@ -1861,8 +1859,6 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { const QVector &d_docs(d.vdocuments.c_vector().v); const QVector &d_sets(d.vsets.c_vector().v); - LOG(("Stickers: clearing everything, got all stickers")); - QByteArray wasHash = cStickersHash(); cSetStickersHash(qba(d.vhash)); @@ -2001,13 +1997,10 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { } } } - LOG(("Stickers: now %1 sets, %2 recent").arg(sets.size()).arg(recent.size())); if (added || removed || cStickersHash() != wasHash) { - LOG(("Stickers: writing stickers from gotAll!")); Local::writeStickers(); } if (writeRecent) { - LOG(("Stickers: writing recent stickers from gotAll!")); Local::writeUserSettings(); } diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 03e302ad66..e99c617ca7 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -2266,7 +2266,7 @@ namespace Local { } } EncryptedDescriptor data(size); - data.stream << quint32(cStickerSetsOrder().size()) << cStickersHash(); + data.stream << quint32(cStickerSets().size()) << cStickersHash(); _writeStickerSet(data.stream, DefaultStickerSetId); _writeStickerSet(data.stream, CustomStickerSetId); for (StickerSetsOrder::const_iterator i = cStickerSetsOrder().cbegin(), e = cStickerSetsOrder().cend(); i != e; ++i) { @@ -2278,19 +2278,15 @@ namespace Local { } void importOldRecentStickers() { - LOG(("Stickers: importOldStickers()")); if (!_recentStickersKeyOld) return; FileReadDescriptor stickers; if (!readEncryptedFile(stickers, _recentStickersKeyOld)) { - LOG(("Stickers: could not readEncryptedFile(_recentStickersKeyOld)!")); clearKey(_recentStickersKeyOld); _recentStickersKeyOld = 0; _writeMap(); return; } - - LOG(("Stickers: clearing everything in import-old!")); StickerSets &sets(cRefStickerSets()); sets.clear(); @@ -2338,7 +2334,6 @@ namespace Local { } if (recent.size() < StickerPanPerRow * StickerPanRowsPerPage && qAbs(value) > 1) recent.push_back(qMakePair(doc, qAbs(value))); } - LOG(("Stickers: read %1 default stickers and %2 custom stickers").arg(def.stickers.size()).arg(custom.stickers.size())); if (def.stickers.isEmpty()) sets.remove(DefaultStickerSetId); if (custom.stickers.isEmpty()) sets.remove(CustomStickerSetId); @@ -2348,25 +2343,21 @@ namespace Local { clearKey(_recentStickersKeyOld); _recentStickersKeyOld = 0; _writeMap(); - LOG(("Stickers: writing stickers and clearing old-stickers")); } void readStickers() { - LOG(("Stickers: readStickers()")); if (!_stickersKey) { return importOldRecentStickers(); } FileReadDescriptor stickers; if (!readEncryptedFile(stickers, _stickersKey)) { - LOG(("Stickers: could not readEncryptedFile(_stickersKey)!")); clearKey(_stickersKey); _stickersKey = 0; _writeMap(); return; } - LOG(("Stickers: clearing everything in read")); StickerSets &sets(cRefStickerSets()); sets.clear(); @@ -2376,6 +2367,10 @@ namespace Local { quint32 cnt; QByteArray hash; stickers.stream >> cnt >> hash; + if (stickers.version < 8019) { + hash.clear(); // bad data in old caches + cnt += 2; // try to read at least something + } for (uint32 i = 0; i < cnt; ++i) { quint64 setId = 0, setAccess = 0; QString setTitle, setShortName; @@ -2386,8 +2381,10 @@ namespace Local { setTitle = lang(lng_stickers_default_set); } else if (setId == CustomStickerSetId) { setTitle = lang(lng_custom_stickers); - } else { + } else if (setId) { order.push_back(setId); + } else { + continue; } StickerSet &set(sets.insert(setId, StickerSet(setId, setAccess, setTitle, setShortName)).value()); set.stickers.reserve(scnt); @@ -2441,8 +2438,6 @@ namespace Local { } cSetStickersHash(hash); - - LOG(("Stickers: read %1 sets").arg(sets.size())); } void writeBackground(int32 id, const QImage &img) { diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 537c7efbd1..2470a17df9 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.8.18 + 0.8.19 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 17cdce1137120225b7270c39c61688b75a1e21a7..433c4390841f8641f4ee214a7b0f78d370d76b07 100644 GIT binary patch delta 53 zcmZ3Yy+nIM5ig_V diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index bf2d220bd7..a298890892 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1693,7 +1693,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.8.18; + CURRENT_PROJECT_VERSION = 0.8.19; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1711,7 +1711,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.8.18; + CURRENT_PROJECT_VERSION = 0.8.19; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1737,10 +1737,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.8.18; + CURRENT_PROJECT_VERSION = 0.8.19; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.8; - DYLIB_CURRENT_VERSION = 0.8.18; + DYLIB_CURRENT_VERSION = 0.8.19; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1880,10 +1880,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.8.18; + CURRENT_PROJECT_VERSION = 0.8.19; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.8; - DYLIB_CURRENT_VERSION = 0.8.18; + DYLIB_CURRENT_VERSION = 0.8.19; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; diff --git a/Telegram/Version.sh b/Telegram/Version.sh index cf96f1b3c0..b2a03b2419 100755 --- a/Telegram/Version.sh +++ b/Telegram/Version.sh @@ -1,2 +1,2 @@ -echo 8018 0.8.18 1 +echo 8019 0.8.19 1 # AppVersion AppVersionStr DevChannel