diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index a56f487508..b326fe3044 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -201,7 +201,7 @@ void HistoryInner::paintEvent(QPaintEvent *e) { return; } - if ((_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems())) { + if (hasPendingResizedItems()) { return; } @@ -1455,9 +1455,7 @@ void HistoryInner::visibleAreaUpdated(int top, int bottom) { _visibleAreaBottom = bottom; // if history has pending resize events we should not update scrollTopItem - if (_history->hasPendingResizedItems()) { - return; - } else if (_migrated && _migrated->hasPendingResizedItems()) { + if (hasPendingResizedItems()) { return; } @@ -1685,7 +1683,7 @@ void HistoryInner::onTouchSelect() { } void HistoryInner::onUpdateSelected() { - if (!_history || _history->hasPendingResizedItems() || (_migrated && _migrated->hasPendingResizedItems())) { + if (!_history || hasPendingResizedItems()) { return; } @@ -3241,7 +3239,13 @@ void HistoryWidget::sendActionDone(const MTPBool &result, mtpRequestId req) { } void HistoryWidget::activate() { - if (_history) updateListSize(true); + if (_history) { + if (!_histInited) { + updateListSize(true); + } else if (hasPendingResizedItems()) { + updateListSize(); + } + } if (App::wnd()) App::wnd()->setInnerFocus(); } @@ -5064,7 +5068,11 @@ void HistoryWidget::doneShow() { updateReportSpamStatus(); updateBotKeyboard(); updateControlsVisibility(); - updateListSize(true); + if (!_histInited) { + updateListSize(true); + } else if (hasPendingResizedItems()) { + updateListSize(); + } preloadHistoryIfNeeded(); if (App::wnd()) { App::wnd()->checkHistoryActivation(); @@ -6296,7 +6304,7 @@ void HistoryWidget::notify_automaticLoadSettingsChangedGif() { } void HistoryWidget::notify_handlePendingHistoryUpdate() { - if ((_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems())) { + if (hasPendingResizedItems()) { updateListSize(); _list->update(); } diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index d8d8b542e8..1ac100c99b 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -169,6 +169,11 @@ private: void applyDragSelection(SelectedItems *toItems) const; void addSelectionRange(SelectedItems *toItems, int32 fromblock, int32 fromitem, int32 toblock, int32 toitem, History *h) const; + // Does any of the shown histories has this flag set. + bool hasPendingResizedItems() const { + return (_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems()); + } + enum DragAction { NoDrag = 0x00, PrepareDrag = 0x01, @@ -847,6 +852,11 @@ private: }; void updateListSize(bool initial = false, bool loadedDown = false, const ScrollChange &change = { ScrollChangeNone, 0 }); + // Does any of the shown histories has this flag set. + bool hasPendingResizedItems() const { + return (_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems()); + } + // Counts scrollTop for placing the scroll right at the unread // messages bar, choosing from _history and _migrated unreadBar. int unreadBarTop() const; diff --git a/Telegram/Updater.xcodeproj/project.pbxproj b/Telegram/Updater.xcodeproj/project.pbxproj index 16e968a965..35279f1175 100644 --- a/Telegram/Updater.xcodeproj/project.pbxproj +++ b/Telegram/Updater.xcodeproj/project.pbxproj @@ -88,7 +88,7 @@ 07084670195445A600B5AE3A /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0730; }; buildConfigurationList = 07084673195445A600B5AE3A /* Build configuration list for PBXProject "Updater" */; compatibilityVersion = "Xcode 3.2"; @@ -138,6 +138,7 @@ CODE_SIGN_IDENTITY = ""; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Telegram.app/Contents/Frameworks"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES;