From 0c1b487956372076daa7882469676f0cc1314bbd Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 31 May 2024 21:30:04 +0400 Subject: [PATCH] Fix dragging of non-leader media. --- .../SourceFiles/history/history_inner_widget.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index c35035854d..48db2a0770 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -1749,12 +1749,13 @@ std::unique_ptr HistoryInner::prepareDrag() { forwardIds = getSelectedItems(); } else if (_mouseCursorState == CursorState::Date) { forwardIds = session().data().itemOrItsGroup(_mouseActionItem); - } else if (pressedView->isHiddenByGroup() && pressedHandler) { - forwardIds = MessageIdsList(1, _mouseActionItem->fullId()); - } else if (const auto media = pressedView->media()) { - if (media->dragItemByHandler(pressedHandler)) { - forwardIds = MessageIdsList(1, _mouseActionItem->fullId()); - } + } else if ((pressedView->isHiddenByGroup() && pressedHandler) + || (pressedView->media() + && pressedView->media()->dragItemByHandler(pressedHandler))) { + const auto item = _dragStateItem + ? _dragStateItem + : _mouseActionItem; + forwardIds = MessageIdsList(1, item->fullId()); } if (forwardIds.empty()) { return nullptr;