Fix dragging of non-leader media.

This commit is contained in:
John Preston 2024-05-31 21:30:04 +04:00
parent ba611d0f2d
commit 0c1b487956
1 changed files with 7 additions and 6 deletions

View File

@ -1749,12 +1749,13 @@ std::unique_ptr<QMimeData> 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;