diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 222f4bddc..1a29f3162 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -511,7 +511,16 @@ HistoryWidget::HistoryWidget( _attachDragAreas = DragArea::SetupDragAreaToContainer( this, crl::guard(this, [=](not_null d) { - return _history && _canSendMessages && !isRecording(); + if (!_peer || isRecording()) { + return false; + } + const auto replyTo = (_replyToId && !_editMsgId) + ? _replyEditMsg + : 0; + const auto topic = replyTo ? replyTo->topic() : nullptr; + return topic + ? Data::CanSendAnyOf(topic, Data::FilesSendRestrictions()) + : Data::CanSendAnyOf(_peer, Data::FilesSendRestrictions()); }), crl::guard(this, [=](bool f) { _field->setAcceptDrops(f); }), crl::guard(this, [=] { updateControlsGeometry(); })); diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index ac40c1e6c..acee9b334 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -2616,9 +2616,18 @@ void RepliesWidget::clearSelected() { } void RepliesWidget::setupDragArea() { + const auto filter = [=](const auto &d) { + if (!_history || _composeControls->isRecording()) { + return false; + } + const auto peer = _history->peer; + return _topic + ? Data::CanSendAnyOf(_topic, Data::FilesSendRestrictions()) + : Data::CanSendAnyOf(peer, Data::FilesSendRestrictions()); + }; const auto areas = DragArea::SetupDragAreaToContainer( this, - [=](auto d) { return _history && !_composeControls->isRecording(); }, + filter, nullptr, [=] { updateControlsGeometry(); });