From 0fffeac8da689d1259e982de9699cac1f0cf36c6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 31 May 2024 19:08:04 +0400 Subject: [PATCH] Fix drag-n-drop forward of selected album. --- Telegram/SourceFiles/history/history_inner_widget.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 57f11e6783..c35035854d 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -1738,7 +1738,16 @@ std::unique_ptr HistoryInner::prepareDrag() { return mimeData; } else if (pressedView) { auto forwardIds = MessageIdsList(); - if (_mouseCursorState == CursorState::Date) { + const auto tryForwardSelection = uponSelected + && !_controller->adaptive().isOneColumn(); + const auto forwardSelectionState = tryForwardSelection + ? getSelectionState() + : HistoryView::TopBarWidget::SelectedState(); + if (forwardSelectionState.count > 0 + && (forwardSelectionState.count + == forwardSelectionState.canForwardCount)) { + forwardIds = getSelectedItems(); + } else if (_mouseCursorState == CursorState::Date) { forwardIds = session().data().itemOrItsGroup(_mouseActionItem); } else if (pressedView->isHiddenByGroup() && pressedHandler) { forwardIds = MessageIdsList(1, _mouseActionItem->fullId());