diff --git a/.appveyor/install.bat b/.appveyor/install.bat index c143e93a2..590d1e0f5 100644 --- a/.appveyor/install.bat +++ b/.appveyor/install.bat @@ -28,7 +28,7 @@ GOTO:EOF git clone -q --depth 1 --branch master https://github.com/telegramdesktop/dependencies_windows.git %LIB_DIR% cd %LIB_DIR% - git clone --depth 1 --branch 0.5.0 https://github.com/ericniebler/range-v3 + git clone --depth 1 --branch 0.9.1 https://github.com/ericniebler/range-v3 if exist prepare.bat ( call prepare.bat diff --git a/.travis/build.sh b/.travis/build.sh index 25daad443..4b6d05ff8 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -28,7 +28,7 @@ GYP_CACHE_VERSION="3" GYP_PATCH="$UPSTREAM/Telegram/Patches/gyp.diff" RANGE_PATH="$BUILD/range-v3" -RANGE_CACHE_VERSION="4" +RANGE_CACHE_VERSION="3" VA_PATH="$BUILD/libva" VA_CACHE_VERSION="3" @@ -217,7 +217,7 @@ buildRange() { rm -rf * cd "$EXTERNAL" - git clone --depth 1 --branch 0.5.0 https://github.com/ericniebler/range-v3 + git clone --depth 1 --branch 0.9.1 https://github.com/ericniebler/range-v3 cd "$EXTERNAL/range-v3" cp -r * "$RANGE_PATH/" diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index 9b0c0ae89..c8751a93b 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -9,7 +9,7 @@ + Version="1.8.12.0" /> Telegram Desktop Telegram FZ-LLC diff --git a/Telegram/SourceFiles/boxes/single_choice_box.cpp b/Telegram/SourceFiles/boxes/single_choice_box.cpp index f617a5fca..f40c82eef 100644 --- a/Telegram/SourceFiles/boxes/single_choice_box.cpp +++ b/Telegram/SourceFiles/boxes/single_choice_box.cpp @@ -38,7 +38,7 @@ void SingleChoiceBox::prepare() { content->add(object_ptr( content, st::boxOptionListPadding.top() + st::autolockButton.margin.top())); - auto &&ints = ranges::view::ints(0); + auto &&ints = ranges::view::ints(0, ranges::unreachable); for (const auto &[i, text] : ranges::view::zip(ints, _optionTexts)) { content->add( object_ptr( diff --git a/Telegram/SourceFiles/chat_helpers/emoji_keywords.cpp b/Telegram/SourceFiles/chat_helpers/emoji_keywords.cpp index 7773fd310..92653bcac 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_keywords.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_keywords.cpp @@ -449,7 +449,7 @@ std::vector EmojiKeywords::LangPack::query( } const auto from = _data.emoji.lower_bound(normalized); - auto &&chosen = ranges::make_iterator_range( + auto &&chosen = ranges::make_subrange( from, end(_data.emoji) ) | ranges::view::take_while([&](const auto &pair) { diff --git a/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp b/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp index 09fd1dc95..f3b6635e2 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp @@ -367,7 +367,7 @@ void Row::paintPreview(Painter &p) const { const auto y = st::manageEmojiPreviewPadding.top(); const auto width = st::manageEmojiPreviewWidth; const auto height = st::manageEmojiPreviewWidth; - auto &&preview = ranges::view::zip(_preview, ranges::view::ints(0)); + auto &&preview = ranges::view::zip(_preview, ranges::view::ints(0, int(_preview.size()))); for (const auto &[pixmap, index] : preview) { const auto row = (index / 2); const auto column = (index % 2); @@ -570,7 +570,7 @@ void Row::setupPreview(const Set &set) { const auto size = st::manageEmojiPreview * cIntRetinaFactor(); const auto original = QImage(set.previewPath); const auto full = original.height(); - auto &&preview = ranges::view::zip(_preview, ranges::view::ints(0)); + auto &&preview = ranges::view::zip(_preview, ranges::view::ints(0, int(_preview.size()))); for (auto &&[pixmap, index] : preview) { pixmap = App::pixmapFromImageInPlace(original.copy( { full * index, 0, full, full } diff --git a/Telegram/SourceFiles/core/core_ui_integration.cpp b/Telegram/SourceFiles/core/core_ui_integration.cpp index a05808707..a8011bd4a 100644 --- a/Telegram/SourceFiles/core/core_ui_integration.cpp +++ b/Telegram/SourceFiles/core/core_ui_integration.cpp @@ -47,7 +47,7 @@ void UiIntegration::textActionsUpdated() { window->updateGlobalMenu(); } } - + void UiIntegration::activationFromTopPanel() { Platform::IgnoreApplicationActivationRightNow(); } @@ -115,7 +115,7 @@ std::shared_ptr UiIntegration::createLinkHandler( bool UiIntegration::handleUrlClick( const QString &url, const QVariant &context) { - auto local = Core::TryConvertUrlToLocal(url); + const auto local = Core::TryConvertUrlToLocal(url); if (Core::InternalPassportLink(local)) { return true; } @@ -123,8 +123,8 @@ bool UiIntegration::handleUrlClick( if (UrlClickHandler::IsEmail(url)) { File::OpenEmailLink(url); return true; - } else if (url.startsWith(qstr("tg://"), Qt::CaseInsensitive)) { - Core::App().openLocalUrl(url, context); + } else if (local.startsWith(qstr("tg://"), Qt::CaseInsensitive)) { + Core::App().openLocalUrl(local, context); return true; } return false; diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 96ac47ba2..cc12ae300 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -15,8 +15,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #define TDESKTOP_ALPHA_VERSION (0ULL) #endif // TDESKTOP_OFFICIAL_TARGET -constexpr auto AppVersion = 1008011; -constexpr auto AppVersionStr = "1.8.11"; +constexpr auto AppVersion = 1008012; +constexpr auto AppVersionStr = "1.8.12"; constexpr auto AppBetaVersion = false; constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION; constexpr auto AppKotatoVersion = 1000003; diff --git a/Telegram/SourceFiles/data/data_channel.cpp b/Telegram/SourceFiles/data/data_channel.cpp index e4496e01d..2435a1631 100644 --- a/Telegram/SourceFiles/data/data_channel.cpp +++ b/Telegram/SourceFiles/data/data_channel.cpp @@ -764,7 +764,7 @@ void ApplyMegagroupAdmins( } auto adding = base::flat_map(); - auto admins = ranges::make_iterator_range( + auto admins = ranges::make_subrange( list.begin(), list.end() ) | ranges::view::transform([](const MTPChannelParticipant &p) { const auto userId = p.match([](const auto &data) { diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 6f71c940a..a0de1069c 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -2962,7 +2962,7 @@ void InnerWidget::setupShortcuts() { Command::ChatPinned4, Command::ChatPinned5, }; - auto &&pinned = ranges::view::zip(kPinned, ranges::view::ints(0)); + auto &&pinned = ranges::view::zip(kPinned, ranges::view::ints(0, ranges::unreachable)); for (const auto [command, index] : pinned) { request->check(command) && request->handle([=, index = index] { const auto list = session().data().chatsList()->indexed(); diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp index 62a5d47aa..aab49845e 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.cpp +++ b/Telegram/SourceFiles/export/data/export_data_types.cpp @@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include #include -#include +#include namespace App { // Hackish.. QString formatPhone(QString phone); diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index abf6b33a7..305f9c71d 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2444,7 +2444,7 @@ MessageIdsList HistoryInner::getSelectedItems() const { return {}; } - auto result = make_iterator_range( + auto result = ranges::make_subrange( _selected.begin(), _selected.end() ) | view::filter([](const auto &selected) { diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index e4f3633da..e6f756616 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -1041,6 +1041,9 @@ void HistoryMessage::applyEdition(const MTPDmessage &message) { // } //} + const auto copyFlags = MTPDmessage::Flag::f_edit_hide; + _flags = (_flags & ~copyFlags) | (message.vflags().v & copyFlags); + if (const auto editDate = message.vedit_date()) { _flags |= MTPDmessage::Flag::f_edit_date; if (!Has()) { diff --git a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp index f2f99451f..1efae8728 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp @@ -87,7 +87,7 @@ QSize Photo::countOptimalSize() { if (_serviceWidth > 0) { return { _serviceWidth, _serviceWidth }; } - const auto minWidth = qMax((!_parent->hasBubble() ? st::minPhotoSize : st::historyPhotoBubbleMinWidth), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x())); + const auto minWidth = qMax((_parent->hasBubble() ? st::historyPhotoBubbleMinWidth : st::minPhotoSize), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x())); const auto maxActualWidth = qMax(tw, minWidth); maxWidth = qMax(maxActualWidth, th); minHeight = qMax(th, st::minPhotoSize); @@ -127,7 +127,7 @@ QSize Photo::countCurrentSize(int newWidth) { if (_pixw < 1) _pixw = 1; if (_pixh < 1) _pixh = 1; - auto minWidth = qMax((!_parent->hasBubble() ? st::minPhotoSize : st::historyPhotoBubbleMinWidth), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x())); + newWidth = qMax(_pixw, minWidth); auto newHeight = qMax(_pixh, st::minPhotoSize); if (_parent->hasBubble() && !_caption.isEmpty()) { diff --git a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp index 886440199..d095ad661 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp @@ -34,6 +34,10 @@ struct PercentCounterItem { int percent = 0; int remainder = 0; + inline bool operator==(const PercentCounterItem &o) const { + return remainder == o.remainder && percent == o.percent; + } + inline bool operator<(const PercentCounterItem &other) const { if (remainder > other.remainder) { return true; @@ -87,7 +91,7 @@ void CountNicePercent( auto &&zipped = ranges::view::zip( votes, items, - ranges::view::ints(0)); + ranges::view::ints(0, int(items.size()))); for (auto &&[votes, item, index] : zipped) { item.index = index; item.percent = (votes * 100) / total; diff --git a/Telegram/SourceFiles/media/streaming/media_streaming_reader.cpp b/Telegram/SourceFiles/media/streaming/media_streaming_reader.cpp index c1e1705d5..79bdfcdd1 100644 --- a/Telegram/SourceFiles/media/streaming/media_streaming_reader.cpp +++ b/Telegram/SourceFiles/media/streaming/media_streaming_reader.cpp @@ -291,7 +291,7 @@ auto Reader::Slice::prepareFill(int from, int till) -> PrepareFillResult { ranges::less(), &PartsMap::value_type::first); const auto haveTill = FindNotLoadedStart( - ranges::make_iterator_range(start, finish), + ranges::make_subrange(start, finish), fromOffset); if (haveTill < till) { result.offsetsFromLoader = offsetsFromLoader( @@ -607,14 +607,14 @@ auto Reader::Slices::fill(int offset, bytes::span buffer) -> FillResult { markSliceUsed(fromSlice); CopyLoaded( buffer, - ranges::make_iterator_range(first.start, first.finish), + ranges::make_subrange(first.start, first.finish), firstFrom, firstTill); if (fromSlice + 1 < tillSlice) { markSliceUsed(fromSlice + 1); CopyLoaded( buffer.subspan(firstTill - firstFrom), - ranges::make_iterator_range(second.start, second.finish), + ranges::make_subrange(second.start, second.finish), secondFrom, secondTill); } @@ -644,7 +644,7 @@ auto Reader::Slices::fillFromHeader(int offset, bytes::span buffer) if (prepared.ready) { CopyLoaded( buffer, - ranges::make_iterator_range(prepared.start, prepared.finish), + ranges::make_subrange(prepared.start, prepared.finish), from, till); result.filled = true; diff --git a/Telegram/SourceFiles/mtproto/config_loader.cpp b/Telegram/SourceFiles/mtproto/config_loader.cpp index 76536dd56..7abc822cc 100644 --- a/Telegram/SourceFiles/mtproto/config_loader.cpp +++ b/Telegram/SourceFiles/mtproto/config_loader.cpp @@ -129,7 +129,11 @@ void ConfigLoader::createSpecialLoader() { const std::string &ip, int port, bytes::const_span secret) { - addSpecialEndpoint(dcId, ip, port, secret); + if (ip.empty()) { + _specialLoader = nullptr; + } else { + addSpecialEndpoint(dcId, ip, port, secret); + } }, _phone); } diff --git a/Telegram/SourceFiles/mtproto/special_config_request.cpp b/Telegram/SourceFiles/mtproto/special_config_request.cpp index 39f9304fa..264fa8fa7 100644 --- a/Telegram/SourceFiles/mtproto/special_config_request.cpp +++ b/Telegram/SourceFiles/mtproto/special_config_request.cpp @@ -374,19 +374,22 @@ SpecialConfigRequest::SpecialConfigRequest( while (!domains.empty()) { _attempts.push_back({ Type::Google, takeDomain(), "dns" }); } - _attempts.push_back({ Type::Realtime, "firebaseio.com" }); - _attempts.push_back({ Type::FireStore, "firestore" }); - for (const auto &domain : DnsDomains()) { - _attempts.push_back({ Type::FireStore, domain, "firestore" }); + if (!_timeDoneCallback) { + _attempts.push_back({ Type::Realtime, "firebaseio.com" }); + _attempts.push_back({ Type::FireStore, "firestore" }); + for (const auto &domain : DnsDomains()) { + _attempts.push_back({ Type::FireStore, domain, "firestore" }); + } } shuffle(0, 2); shuffle(2, 4); - shuffle( - _attempts.size() - (2 + domainsCount), - _attempts.size() - domainsCount); - shuffle(_attempts.size() - domainsCount, _attempts.size()); - + if (!_timeDoneCallback) { + shuffle( + _attempts.size() - (2 + domainsCount), + _attempts.size() - domainsCount); + shuffle(_attempts.size() - domainsCount, _attempts.size()); + } ranges::reverse(_attempts); // We go from last to first. sendNextRequest(); @@ -666,20 +669,27 @@ void SpecialConfigRequest::handleResponse(const QByteArray &bytes) { switch (address.type()) { case mtpc_ipPort: { const auto &fields = address.c_ipPort(); - _callback(dcId, parseIp(fields.vipv4()), fields.vport().v, {}); + const auto ip = parseIp(fields.vipv4()); + if (!ip.empty()) { + _callback(dcId, ip, fields.vport().v, {}); + } } break; case mtpc_ipPortSecret: { const auto &fields = address.c_ipPortSecret(); - _callback( - dcId, - parseIp(fields.vipv4()), - fields.vport().v, - bytes::make_span(fields.vsecret().v)); + const auto ip = parseIp(fields.vipv4()); + if (!ip.empty()) { + _callback( + dcId, + ip, + fields.vport().v, + bytes::make_span(fields.vsecret().v)); + } } break; default: Unexpected("Type in simpleConfig ips."); } } } + _callback(0, std::string(), 0, {}); } DomainResolver::DomainResolver(Fn &to) { @end // @interface PickerScrubberItemView @implementation PickerScrubberItemView { rpl::lifetime _lifetime; - Data::FileOrigin _origin; QSize _dimensions; Image *_image; + @public + Data::FileOrigin fileOrigin; + DocumentData *documentData; } - (instancetype)initWithFrame:(NSRect)frameRect { @@ -667,9 +680,10 @@ void AppendEmojiPacks(std::vector &to) { if (!_image) { return; } + fileOrigin = document->stickerSetOrigin(); + documentData = std::move(document); _dimensions = document->dimensions; - _origin = document->stickerSetOrigin(); - _image->load(_origin); + _image->load(fileOrigin); if (_image->loaded()) { [self updateImage]; return; @@ -689,7 +703,7 @@ void AppendEmojiPacks(std::vector &to) { .scaled(kCircleDiameter, kCircleDiameter, Qt::KeepAspectRatio); _imageView.image = [qt_mac_create_nsimage( _image->pixSingle( - _origin, + fileOrigin, size.width(), size.height(), kCircleDiameter, @@ -711,9 +725,7 @@ void AppendEmojiPacks(std::vector &to) { @implementation PickerCustomTouchBarItem { std::vector _stickers; NSPopoverTouchBarItem *_parentPopover; - std::unique_ptr _previewTimer; - int _highlightedIndex; - bool _previewShown; + DocumentId _lastPreviewedSticker; } - (id) init:(ScrubberItemType)type popover:(NSPopoverTouchBarItem *)popover { @@ -739,18 +751,65 @@ void AppendEmojiPacks(std::vector &to) { [scrubber registerClass:[NSScrubberTextItemView class] forItemIdentifier:kPickerTitleItemIdentifier]; [scrubber registerClass:[NSScrubberImageItemView class] forItemIdentifier:kEmojiItemIdentifier]; - _previewShown = false; - _highlightedIndex = 0; - _previewTimer = !IsSticker(type) - ? nullptr - : std::make_unique([=] { - [self showPreview]; - }); + if (IsSticker(type)) { + auto *gesture = [[NSPressGestureRecognizer alloc] + initWithTarget:self + action:@selector(gesturePreviewHandler:)]; + gesture.allowedTouchTypes = NSTouchTypeMaskDirect; + gesture.minimumPressDuration = QApplication::startDragTime() / 1000.; + gesture.allowableMovement = 0; + [scrubber addGestureRecognizer:gesture]; + } + _lastPreviewedSticker = 0; self.view = scrubber; return self; } +- (void)gesturePreviewHandler:(NSPressGestureRecognizer *)gesture { + const auto customEnter = [](const auto callback) { + Core::Sandbox::Instance().customEnterFromEventLoop([=] { + if (App::wnd()) { + callback(); + } + }); + }; + + const auto checkState = [&](const auto &states) { + return ranges::find(states, gesture.state) != end(states); + }; + + if (checkState(kGestureStateProcessed)) { + NSScrollView *scrollView = self.view; + auto *container = scrollView.documentView.subviews.firstObject; + if (!container) { + return; + } + const auto point = [gesture locationInView:(std::move(container))]; + + for (PickerScrubberItemView *item in container.subviews) { + const auto &doc = item->documentData; + const auto &origin = item->fileOrigin + ? item->fileOrigin + : Data::FileOrigin(); + if (![item isMemberOfClass:[PickerScrubberItemView class]] + || !doc + || (doc->id == _lastPreviewedSticker) + || !NSPointInRect(point, item.frame)) { + continue; + } + _lastPreviewedSticker = doc->id; + customEnter([origin = std::move(origin), doc = std::move(doc)] { + App::wnd()->showMediaPreview(origin, doc); + }); + break; + } + } else if (checkState(kGestureStateFinished)) { + customEnter([] { App::wnd()->hideMediaPreview(); }); + _lastPreviewedSticker = 0; + } +} + - (void)encodeWithCoder:(nonnull NSCoder *)aCoder { // Has not been implemented. } @@ -765,7 +824,7 @@ void AppendEmojiPacks(std::vector &to) { const auto item = _stickers[index]; if (const auto document = item.document) { PickerScrubberItemView *itemView = [scrubber makeItemWithIdentifier:kStickerItemIdentifier owner:nil]; - [itemView addDocument:document]; + [itemView addDocument:(std::move(document))]; return itemView; } else if (const auto emoji = item.emoji) { NSScrubberImageItemView *itemView = [scrubber makeItemWithIdentifier:kEmojiItemIdentifier owner:nil]; @@ -791,12 +850,6 @@ void AppendEmojiPacks(std::vector &to) { return; } scrubber.selectedIndex = -1; - if (_previewShown && [self hidePreview]) { - return; - } - if (_previewTimer) { - _previewTimer->cancel(); - } const auto chat = GetActiveChat(); const auto callback = [&]() -> bool { @@ -828,47 +881,6 @@ void AppendEmojiPacks(std::vector &to) { } } -- (void)scrubber:(NSScrubber *)scrubber didHighlightItemAtIndex:(NSInteger)index { - if (_previewTimer) { - _previewTimer->callOnce(QApplication::startDragTime()); - _highlightedIndex = index; - } -} - -- (void)scrubber:(NSScrubber *)scrubber didChangeVisibleRange:(NSRange)visibleRange { - [self didCancelInteractingWithScrubber:scrubber]; -} - -- (void)didCancelInteractingWithScrubber:(NSScrubber *)scrubber { - if (_previewTimer) { - _previewTimer->cancel(); - } - if (_previewShown) { - [self hidePreview]; - } -} - -- (void)showPreview { - if (const auto document = _stickers[_highlightedIndex].document) { - if (const auto w = App::wnd()) { - w->showMediaPreview(document->stickerSetOrigin(), document); - _previewShown = true; - } - } -} - -- (bool)hidePreview { - if (const auto w = App::wnd()) { - Core::Sandbox::Instance().customEnterFromEventLoop([=] { - w->hideMediaPreview(); - }); - _previewShown = false; - _highlightedIndex = 0; - return true; - } - return false; -} - - (void)updateStickers { std::vector temp; if (const auto error = RestrictionToSendStickers()) { diff --git a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm index cbf4f5529..76f3a2792 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm @@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "platform/platform_info.h" #include "lang/lang_keys.h" #include "base/timer.h" +#include "facades.h" #include "styles/style_window.h" #include diff --git a/Telegram/SourceFiles/ui/grouped_layout.cpp b/Telegram/SourceFiles/ui/grouped_layout.cpp index 8cd1a3bd8..7b98af8b3 100644 --- a/Telegram/SourceFiles/ui/grouped_layout.cpp +++ b/Telegram/SourceFiles/ui/grouped_layout.cpp @@ -117,7 +117,7 @@ std::string Layouter::CountProportions(const std::vector &ratios) { ratios ) | ranges::view::transform([](float64 ratio) { return (ratio > 1.2) ? 'w' : (ratio < 0.8) ? 'n' : 'q'; - }) | ranges::to_(); + }) | ranges::to(); } std::vector Layouter::layout() const { diff --git a/Telegram/SourceFiles/ui/image/image_prepare.cpp b/Telegram/SourceFiles/ui/image/image_prepare.cpp index ea011b0d0..52631dd93 100644 --- a/Telegram/SourceFiles/ui/image/image_prepare.cpp +++ b/Telegram/SourceFiles/ui/image/image_prepare.cpp @@ -262,7 +262,7 @@ QImage BlurLargeImage(QImage image, int radius) { const auto dvs = take(dvcount); auto &&ints = ranges::view::ints; - for (auto &&[value, index] : ranges::view::zip(dvs, ints(0))) { + for (auto &&[value, index] : ranges::view::zip(dvs, ints(0, ranges::unreachable))) { value = (index / divsum); } const auto dv = dvs.data(); diff --git a/Telegram/SourceFiles/ui/text/text_entity.cpp b/Telegram/SourceFiles/ui/text/text_entity.cpp index 4f3378fcb..c2c08a6cd 100644 --- a/Telegram/SourceFiles/ui/text/text_entity.cpp +++ b/Telegram/SourceFiles/ui/text/text_entity.cpp @@ -1141,7 +1141,7 @@ const QRegularExpression &RegExpWordSplit() { [[nodiscard]] QString ExpandCustomLinks(const TextWithTags &text) { const auto entities = ConvertTextTagsToEntities(text.tags); - auto &&urls = ranges::make_iterator_range( + auto &&urls = ranges::make_subrange( entities.begin(), entities.end() ) | ranges::view::filter([](const EntityInText &entity) { @@ -2098,7 +2098,7 @@ EntityInText::EntityInText( int EntityInText::FirstMonospaceOffset( const EntitiesInText &entities, int textLength) { - auto &&monospace = ranges::make_iterator_range( + auto &&monospace = ranges::make_subrange( entities.begin(), entities.end() ) | ranges::view::filter([](const EntityInText & entity) { diff --git a/Telegram/build/version b/Telegram/build/version index 79c72f46d..2d9a30cb5 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,6 +1,6 @@ -AppVersion 1008011 +AppVersion 1008012 AppVersionStrMajor 1.8 -AppVersionStrSmall 1.8.11 -AppVersionStr 1.8.11 +AppVersionStrSmall 1.8.12 +AppVersionStr 1.8.12 BetaChannel 0 AlphaVersion 0 diff --git a/Telegram/gyp/common/mac.gypi b/Telegram/gyp/common/mac.gypi index 659527825..781cb69b7 100644 --- a/Telegram/gyp/common/mac.gypi +++ b/Telegram/gyp/common/mac.gypi @@ -64,6 +64,7 @@ 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', 'GCC_OPTIMIZATION_LEVEL': '0', + 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'NO', # temp for range-v3 'ALWAYS_SEARCH_USER_PATHS': 'NO', }, 'configurations': { @@ -88,6 +89,7 @@ 'OTHER_LDFLAGS': [ '-w', # Suppress 'libstdc++ is deprecated' warning. ], + 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'NO', # temp for range-v3 }, 'defines': [ 'OS_MAC_OLD', diff --git a/Telegram/gyp/common/win.gypi b/Telegram/gyp/common/win.gypi index 3d2c779c5..e1d9df16d 100644 --- a/Telegram/gyp/common/win.gypi +++ b/Telegram/gyp/common/win.gypi @@ -33,6 +33,8 @@ '/w14834', # [[nodiscard]] '/w15038', # wrong initialization order '/w14265', # class has virtual functions, but destructor is not virtual + '/experimental:preprocessor', # need for range-v3 see https://github.com/ericniebler/range-v3#supported-compilers + '/wd5105', # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior" ], 'TreatWChar_tAsBuiltInType': 'false', }, diff --git a/Telegram/gyp/lib_ui.gyp b/Telegram/gyp/lib_ui.gyp index 81810062e..fa6bd4ea3 100644 --- a/Telegram/gyp/lib_ui.gyp +++ b/Telegram/gyp/lib_ui.gyp @@ -45,6 +45,14 @@ }, 'defines': [ ], + 'conditions': [[ 'build_macold', { + 'xcode_settings': { + 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ], + }, + 'include_dirs': [ + '/usr/local/macold/include/c++/v1', + ], + }]], 'include_dirs': [ '<(src_loc)', '<(SHARED_INTERMEDIATE_DIR)', diff --git a/changelog.txt b/changelog.txt index 650a00b43..6a79a1504 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +1.8.12 (02.10.19) + +- Bug fixes and other minor improvements. + 1.8.11 (01.10.19) - Bug fixes and other minor improvements. diff --git a/docs/building-cmake.md b/docs/building-cmake.md index ce59fd5f7..efc27ec3b 100644 --- a/docs/building-cmake.md +++ b/docs/building-cmake.md @@ -38,7 +38,7 @@ Go to ***BuildPath*** and run mkdir Libraries cd Libraries - git clone --branch 0.5.0 https://github.com/ericniebler/range-v3 + git clone --branch 0.9.1 https://github.com/ericniebler/range-v3 git clone https://github.com/telegramdesktop/zlib.git cd zlib diff --git a/docs/building-msvc.md b/docs/building-msvc.md index f233105c7..74e513eba 100644 --- a/docs/building-msvc.md +++ b/docs/building-msvc.md @@ -55,7 +55,7 @@ Open **x86 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath*** mkdir Libraries cd Libraries - git clone --branch 0.5.0 https://github.com/ericniebler/range-v3 range-v3 + git clone --branch 0.9.1 https://github.com/ericniebler/range-v3 range-v3 git clone https://github.com/telegramdesktop/lzma.git cd lzma\C\Util\LzmaLib diff --git a/docs/building-xcode.md b/docs/building-xcode.md index 90132d111..8dfec1897 100644 --- a/docs/building-xcode.md +++ b/docs/building-xcode.md @@ -30,7 +30,7 @@ Go to ***BuildPath*** and run cd Libraries - git clone --branch 0.5.0 https://github.com/ericniebler/range-v3 + git clone --branch 0.9.1 https://github.com/ericniebler/range-v3 cd xz-5.0.5 CFLAGS="-mmacosx-version-min=10.8" LDFLAGS="-mmacosx-version-min=10.8" ./configure diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index bc61fef9a..1adc7047f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -393,7 +393,7 @@ parts: range-v3: source: https://github.com/ericniebler/range-v3.git source-depth: 1 - source-tag: 0.5.0 + source-tag: 0.9.1 plugin: nil override-build: | set -x