From e3e7cf088c2d4c10ca4f9f28eb758d40aae358ed Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Sep 2015 11:58:10 +0300 Subject: [PATCH] version 0.9 stable prepared --- Telegram/BuildWin.bat | 12 ++--- Telegram/SourceFiles/boxes/contactsbox.cpp | 4 +- Telegram/SourceFiles/config.h | 6 +-- Telegram/SourceFiles/mainwidget.cpp | 54 +++++++------------- Telegram/SourceFiles/mainwidget.h | 2 +- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | Bin 5540 -> 5532 bytes Telegram/Telegram.xcodeproj/project.pbxproj | 24 ++++----- Telegram/Version.sh | 2 +- 9 files changed, 45 insertions(+), 61 deletions(-) diff --git a/Telegram/BuildWin.bat b/Telegram/BuildWin.bat index 017d7988f..0f79a8b66 100644 --- a/Telegram/BuildWin.bat +++ b/Telegram/BuildWin.bat @@ -1,11 +1,11 @@ @echo OFF -set "AppVersionStrMajor=0.8" -set "AppVersion=8059" -set "AppVersionStrSmall=0.8.59" -set "AppVersionStr=0.8.59" -set "AppVersionStrFull=0.8.59.0" -set "DevChannel=1" +set "AppVersionStrMajor=0.9" +set "AppVersion=9000" +set "AppVersionStrSmall=0.9" +set "AppVersionStr=0.9.0" +set "AppVersionStrFull=0.9.0.0" +set "DevChannel=0" if %DevChannel% neq 0 goto preparedev diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index c62fe8371..b2b136474 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -1904,7 +1904,7 @@ void MembersBox::resizeEvent(QResizeEvent *e) { } void MembersBox::onLoaded() { - if (!_done.isHidden() && _inner.channel()->amCreator() && (_inner.channel()->count < cMaxGroupCount() || !_inner.channel()->isPublic())) { + if (!_done.isHidden() && _inner.channel()->amCreator() && (_inner.channel()->count < cMaxGroupCount() || !_inner.channel()->isPublic() || _inner.filter() == MembersFilterAdmins)) { _add.show(); } } @@ -1944,7 +1944,7 @@ void MembersBox::hideAll() { void MembersBox::showAll() { ItemListBox::showAll(); - if (_inner.channel()->amCreator() && _inner.isLoaded() && (_inner.channel()->count < cMaxGroupCount() || !_inner.channel()->isPublic())) { + if (_inner.channel()->amCreator() && _inner.isLoaded() && (_inner.channel()->count < cMaxGroupCount() || !_inner.channel()->isPublic() || _inner.filter() == MembersFilterAdmins)) { _add.show(); } else { _add.hide(); diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 8e6ab54ce..bce3f56f7 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -17,9 +17,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 8059; -static const wchar_t *AppVersionStr = L"0.8.59"; -static const bool DevVersion = true; +static const int32 AppVersion = 9000; +static const wchar_t *AppVersionStr = L"0.9"; +static const bool DevVersion = false; static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 537d154e8..b9763d8be 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -767,15 +767,7 @@ bool MainWidget::leaveChatFailed(PeerData *peer, const RPCError &error) { if (error.type().startsWith(qsl("FLOOD_WAIT_"))) return false; if (error.type() == qstr("USER_NOT_PARTICIPANT") || error.type() == qstr("CHAT_ID_INVALID")) { // left this chat already - if ((profile && profile->peer() == peer) || (overview && overview->peer() == peer) || _stack.contains(peer) || history.peer() == peer) { - showDialogs(); - } - dialogs.removePeer(peer); - if (History *h = App::historyLoaded(peer->id)) { - h->clear(); - h->newLoaded = h->oldLoaded = true; - } - MTP::send(MTPmessages_DeleteHistory(peer->input, MTP_int(0)), rpcDone(&MainWidget::deleteHistoryPart, peer)); + deleteConversation(peer); return true; } return false; @@ -783,15 +775,7 @@ bool MainWidget::leaveChatFailed(PeerData *peer, const RPCError &error) { void MainWidget::deleteHistoryAfterLeave(PeerData *peer, const MTPUpdates &updates) { sentUpdatesReceived(updates); - if ((profile && profile->peer() == peer) || (overview && overview->peer() == peer) || _stack.contains(peer) || history.peer() == peer) { - showDialogs(); - } - dialogs.removePeer(peer); - if (History *h = App::historyLoaded(peer->id)) { - h->clear(); - h->newLoaded = h->oldLoaded = true; - } - MTP::send(MTPmessages_DeleteHistory(peer->input, MTP_int(0)), rpcDone(&MainWidget::deleteHistoryPart, peer)); + deleteConversation(peer); } void MainWidget::deleteHistoryPart(PeerData *peer, const MTPmessages_AffectedHistory &result) { @@ -827,14 +811,25 @@ void MainWidget::deletedContact(UserData *user, const MTPcontacts_Link &result) App::emitPeerUpdated(); } -void MainWidget::deleteConversation(PeerData *peer) { +void MainWidget::deleteConversation(PeerData *peer, bool deleteHistory) { + if (activePeer() == peer) { + showDialogs(); + } dialogs.removePeer(peer); if (History *h = App::historyLoaded(peer->id)) { h->clear(); - h->newLoaded = h->oldLoaded = true; + h->newLoaded = true; + h->oldLoaded = deleteHistory; + if (h->isChannel()) { + h->asChannelHistory()->clearOther(); + } + } + if (peer->isChannel()) { + peer->asChannel()->ptsWaitingForShortPoll(-1); + } + if (deleteHistory) { + MTP::send(MTPmessages_DeleteHistory(peer->input, MTP_int(0)), rpcDone(&MainWidget::deleteHistoryPart, peer)); } - showDialogs(); - MTP::send(MTPmessages_DeleteHistory(peer->input, MTP_int(0)), rpcDone(&MainWidget::deleteHistoryPart, peer)); } void MainWidget::clearHistory(PeerData *peer) { @@ -955,10 +950,7 @@ void MainWidget::checkedHistory(PeerData *peer, const MTPmessages_Messages &resu if (v->isEmpty()) { if (peer->isChat() && peer->asChat()->haveLeft) { - dialogs.removePeer(peer); - if (history.peer() == peer) { - showDialogs(); - } + deleteConversation(peer, false); } else if (peer->isChannel()) { if (peer->asChannel()->inviter > 0 && peer->asChannel()->amIn()) { if (UserData *from = App::userLoaded(peer->asChannel()->inviter)) { @@ -4514,15 +4506,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { App::markPeerUpdated(channel); channel->inviter = 0; if (!channel->amIn()) { - dialogs.removePeer(channel); - if (History *h = App::historyLoaded(channel->id)) { - h->clear(true); - h->asChannelHistory()->clearOther(); - } - channel->ptsWaitingForShortPoll(-1); - if (activePeer() == channel) { - showDialogs(); - } + deleteConversation(channel, false); } else if (!channel->amCreator() && App::history(channel->id)) { // create history _updatedChannels.insert(channel, true); App::api()->requestSelfParticipant(channel); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index a7ca59a1e..35b58eeb3 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -289,7 +289,7 @@ public: void deleteHistoryPart(PeerData *peer, const MTPmessages_AffectedHistory &result); void deleteMessages(PeerData *peer, const QVector &ids); void deletedContact(UserData *user, const MTPcontacts_Link &result); - void deleteConversation(PeerData *peer); + void deleteConversation(PeerData *peer, bool deleteHistory = true); void clearHistory(PeerData *peer); void removeContact(UserData *user); diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index a24d61cc8..e46ace21f 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.8.59 + 0.9 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) CFBundleSignature diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 9db6168da455cce3ce745421b5f21cae308fa573..8d41f7716893682ad32236ba3fdfa17f1b9ef36b 100644 GIT binary patch delta 69 zcmZ3YJx6;(4lk=EgARkiq!w^^i diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index cea7b7bdd..adb35c30b 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1697,7 +1697,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.8.59; + CURRENT_PROJECT_VERSION = 0.9; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1715,7 +1715,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.8.59; + CURRENT_PROJECT_VERSION = 0.9; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1741,10 +1741,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.8.59; + CURRENT_PROJECT_VERSION = 0.9; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_COMPATIBILITY_VERSION = 0.8; - DYLIB_CURRENT_VERSION = 0.8.59; + DYLIB_COMPATIBILITY_VERSION = 0.9; + DYLIB_CURRENT_VERSION = 0.9; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1792,7 +1792,7 @@ "/usr/local/Qt-5.5.0/plugins/imageformats", "./../../Libraries/openssl-xcode", ); - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; OBJROOT = "./../Mac/$(CONFIGURATION)Intermediate"; OTHER_CFLAGS = ( "-pipe", @@ -1875,10 +1875,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.8.59; + CURRENT_PROJECT_VERSION = 0.9; DEBUG_INFORMATION_FORMAT = dwarf; - DYLIB_COMPATIBILITY_VERSION = 0.8; - DYLIB_CURRENT_VERSION = 0.8.59; + DYLIB_COMPATIBILITY_VERSION = 0.9; + DYLIB_CURRENT_VERSION = 0.9; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1926,7 +1926,7 @@ "/usr/local/Qt-5.5.0/plugins/imageformats", "./../../Libraries/openssl-xcode", ); - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; OBJROOT = "./../Mac/$(CONFIGURATION)Intermediate"; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( @@ -2003,7 +2003,7 @@ COMBINE_HIDPI_IMAGES = YES; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; LLVM_LTO = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; OBJROOT = ./../Mac/ReleaseIntermediate; QT_LIBRARY_SUFFIX = ""; SDKROOT = macosx; @@ -2018,7 +2018,7 @@ CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; OBJROOT = ./../Mac/DebugIntermediate; QT_LIBRARY_SUFFIX = _debug; SDKROOT = macosx; diff --git a/Telegram/Version.sh b/Telegram/Version.sh index 3cde3a50b..71f4c4c30 100755 --- a/Telegram/Version.sh +++ b/Telegram/Version.sh @@ -1,2 +1,2 @@ -echo 0.8 8059 0.8.59 1 +echo 0.9 9000 0.9.0 0 # AppVersionStrMajor AppVersion AppVersionStr DevChannel