From c170a861897dbbea5f973b0a60893cc6caea5548 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 28 Jul 2021 15:59:42 +0300 Subject: [PATCH] Fix build on Windows. --- Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp | 2 +- Telegram/SourceFiles/core/click_handler_types.cpp | 5 +++-- Telegram/SourceFiles/inline_bots/inline_results_inner.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp index 00e41b1e3..ada995951 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -878,7 +878,7 @@ void GifsListWidget::updateSelected() { const auto sy = p.y(); const auto &[index, exact, relative] = _mosaic.findByPoint({ sx, sy }); const auto selected = exact ? index : -1; - const auto item = exact ? _mosaic.itemAt(selected) : nullptr; + const auto item = exact ? _mosaic.itemAt(selected).get() : nullptr; const auto link = exact ? item->getState(relative, {}).link : nullptr; if (_selected != selected) { diff --git a/Telegram/SourceFiles/core/click_handler_types.cpp b/Telegram/SourceFiles/core/click_handler_types.cpp index d7caa8b3b..e15f9b5a3 100644 --- a/Telegram/SourceFiles/core/click_handler_types.cpp +++ b/Telegram/SourceFiles/core/click_handler_types.cpp @@ -46,7 +46,7 @@ void SearchByHashtag(ClickContext context, const QString &tag) { const auto inPeer = my.peer ? my.peer : my.itemId - ? data.message(my.itemId)->history()->peer + ? data.message(my.itemId)->history()->peer.get() : nullptr; controller->content()->searchMessages( tag + ' ', @@ -223,10 +223,11 @@ void BotCommandClickHandler::onClick(ClickContext context) const { if (const auto delegate = my.elementDelegate ? my.elementDelegate() : nullptr) { delegate->elementSendBotCommand(_cmd, my.itemId); } else if (const auto controller = my.sessionWindow.get()) { + auto &data = controller->session().data(); const auto peer = my.peer ? my.peer : my.itemId - ? controller->session().data().message(my.itemId)->history()->peer + ? data.message(my.itemId)->history()->peer.get() : nullptr; // Can't find context. if (!peer) { diff --git a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp index c161d2765..2950a32a8 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp @@ -557,7 +557,7 @@ void Inner::updateSelected() { const auto sy = p.y(); const auto &[index, exact, relative] = _mosaic.findByPoint({ sx, sy }); const auto selected = exact ? index : -1; - const auto item = exact ? _mosaic.itemAt(selected) : nullptr; + const auto item = exact ? _mosaic.itemAt(selected).get() : nullptr; const auto link = exact ? item->getState(relative, {}).link : nullptr; if (_selected != selected) {