From 591a0aaa160fba0f5e0be4e01259a7d8848633d1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Dec 2015 23:31:21 +0300 Subject: [PATCH 1/2] beta version 9015001 with new media design --- Telegram/FixMake.sh | 1 + Telegram/FixMake32.sh | 1 + Telegram/SourceFiles/config.h | 2 +- Telegram/Telegram.pro | 4 ++- Telegram/Telegram.rc | 50 ++++++----------------------------- Telegram/Version | 2 +- 6 files changed, 15 insertions(+), 45 deletions(-) diff --git a/Telegram/FixMake.sh b/Telegram/FixMake.sh index 77a933e1a..eef0eb343 100755 --- a/Telegram/FixMake.sh +++ b/Telegram/FixMake.sh @@ -27,4 +27,5 @@ Replace '\-lopenal' '\/usr\/local\/lib\/libopenal\.a' Replace '\-lavformat' '\/usr\/local\/lib\/libavformat\.a' Replace '\-lavcodec' '\/usr\/local\/lib\/libavcodec\.a' Replace '\-lswresample' '\/usr\/local\/lib\/libswresample\.a' +Replace '\-lswscale' '\/usr\/local\/lib\/libswscale\.a' Replace '\-lavutil' '\/usr\/local\/lib\/libavutil\.a' diff --git a/Telegram/FixMake32.sh b/Telegram/FixMake32.sh index 4b7591ab5..747c60b36 100755 --- a/Telegram/FixMake32.sh +++ b/Telegram/FixMake32.sh @@ -27,4 +27,5 @@ Replace '\-lopenal' '\/usr\/local\/lib\/libopenal\.a' Replace '\-lavformat' '\/usr\/local\/lib\/libavformat\.a' Replace '\-lavcodec' '\/usr\/local\/lib\/libavcodec\.a' Replace '\-lswresample' '\/usr\/local\/lib\/libswresample\.a' +Replace '\-lswscale' '\/usr\/local\/lib\/libswscale\.a' Replace '\-lavutil' '\/usr\/local\/lib\/libavutil\.a' diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index a832dedcc..dd65f2514 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9015; static const wchar_t *AppVersionStr = L"0.9.15"; static const bool DevVersion = false; -//#define BETA_VERSION (9014003ULL) // just comment this line to build public version +#define BETA_VERSION (9015001ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index bcd1aad60..057af1c44 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -96,6 +96,7 @@ SOURCES += \ ./SourceFiles/lang.cpp \ ./SourceFiles/langloaderplain.cpp \ ./SourceFiles/layerwidget.cpp \ + ./SourceFiles/layout.cpp \ ./SourceFiles/mediaview.cpp \ ./SourceFiles/overviewwidget.cpp \ ./SourceFiles/passcodewidget.cpp \ @@ -183,6 +184,7 @@ HEADERS += \ ./SourceFiles/lang.h \ ./SourceFiles/langloaderplain.h \ ./SourceFiles/layerwidget.h \ + ./SourceFiles/layout.h \ ./SourceFiles/mediaview.h \ ./SourceFiles/numbers.h \ ./SourceFiles/overviewwidget.h \ @@ -306,7 +308,7 @@ INCLUDEPATH += "/usr/include/atk-1.0" INCLUDEPATH += "/usr/include/dee-1.0" INCLUDEPATH += "/usr/include/libdbusmenu-glib-0.4" -LIBS += -lcrypto -lssl -lz -ldl -llzma -lexif -lopenal -lavformat -lavcodec -lswresample -lavutil -lopus +LIBS += -lcrypto -lssl -lz -ldl -llzma -lexif -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus LIBS += ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.a \ ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libibusplatforminputcontextplugin.a \ ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.a diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 47e1ea11c..f27155485 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -13,36 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// Russian (Russia) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) -LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED +// English (United States) resources +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) ///////////////////////////////////////////////////////////////////////////// // @@ -52,15 +27,6 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" -#endif // Russian (Russia) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US ///////////////////////////////////////////////////////////////////////////// // @@ -68,8 +34,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,15,0 - PRODUCTVERSION 0,9,15,0 + FILEVERSION 0,9,15,1 + PRODUCTVERSION 0,9,15,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -85,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.15.0" + VALUE "FileVersion", "0.9.15.1" VALUE "LegalCopyright", "Copyright (C) 2013" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.15.0" + VALUE "ProductVersion", "0.9.15.1" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index 88016d82f..5850195c2 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.15 AppVersionStr 0.9.15 DevChannel 0 -BetaVersion 0 9014003 +BetaVersion 9015001 From 32ed45e399e96834832b5655837e8dbd413fd1a3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Dec 2015 00:27:45 +0300 Subject: [PATCH 2/2] fixed service messages handling for 9015001 --- Telegram/SourceFiles/history.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 1a2239850..9636aeb67 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -624,7 +624,7 @@ void ChannelHistory::addNewGroup(const MTPMessageGroup &group) { for (Blocks::iterator i = blocks.begin(), e = blocks.end(); i != e; ++i) { (*i)->y += dh; } - blocks.push_front(dateBlock); // date block + blocks.push_front(dateBlock); // date block CHECK height += dh; } } @@ -719,7 +719,7 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { } } if (!block->items.isEmpty()) { - blocks.push_front(block); + blocks.push_front(block); // CHECK if (width) { addToH += block->height; ++skip; @@ -740,7 +740,7 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { addToH += dh; ++skip; } - blocks.push_front(dateBlock); // date block + blocks.push_front(dateBlock); // date block CHECK } if (width && addToH) { for (Blocks::iterator i = blocks.begin(), e = blocks.end(); i != e; ++i) { @@ -945,7 +945,7 @@ void ChannelHistory::switchMode() { item->attach(block); prev = addItemAfterPrevToBlock(item, prev, block); } - blocks.push_back(block); + blocks.push_back(block); // CHECK if (width) { block->y = height; height += block->height; @@ -1326,13 +1326,10 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo HistoryItem *result = App::histItemById(channelId(), msgId); if (result) { if (block) { - if (result->detached()) { - result->attach(block); - } else if (result->block() != block) { - LOG(("App Error: createItem() called for existing item in other block!")); - result->destroy(); - result = 0; + if (!result->detached()) { + result->detach(); } + result->attach(block); } if (result) { if (msg.type() == mtpc_message) { @@ -1600,7 +1597,14 @@ HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type) } else { to = blocks.back(); } - return addNewItem(to, newBlock, createItem(to, msg, (type == NewMessageUnread)), (type == NewMessageUnread)); + HistoryItem *item = createItem((type == NewMessageLast) ? 0 : to, msg, (type == NewMessageUnread)); + if (type == NewMessageLast) { + if (!item->detached()) { + return item; + } + item->attach(to); + } + return addNewItem(to, newBlock, item, (type == NewMessageUnread)); } HistoryItem *History::addToHistory(const MTPMessage &msg) { @@ -1862,7 +1866,7 @@ HistoryItem *History::addMessageGroupAfterPrev(HistoryItem *newItem, HistoryItem createInitialDateBlock(date); block = new HistoryBlock(this); - blocks.push_back(block); + blocks.push_back(block); // CHECK if (width) { block->y = height; }