From 42d9537ad13c0a9446dfa150c22fd214552e92aa Mon Sep 17 00:00:00 2001 From: Heejune Kim Date: Sun, 13 Dec 2015 20:40:57 +0900 Subject: [PATCH] Resolving a bug #1247 (Sending files to channels) Signed-off-by: Heejune Kim (github: heejune) --- Telegram/SourceFiles/historywidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 02762346c9..afe6316dfd 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4575,6 +4575,8 @@ void HistoryWidget::onDocumentSelect() { void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) { if (!_history) return; + if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; + _attachDrag = getDragState(e->mimeData()); updateDragAreas(); @@ -4876,6 +4878,8 @@ void HistoryWidget::onPhotoDrop(const QMimeData *data) { void HistoryWidget::onDocumentDrop(const QMimeData *data) { if (!_history) return; + if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; + QStringList files = getMediasFromMime(data); if (files.isEmpty()) return; @@ -4883,6 +4887,9 @@ void HistoryWidget::onDocumentDrop(const QMimeData *data) { } void HistoryWidget::onFilesDrop(const QMimeData *data) { + + if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; + QStringList files = getMediasFromMime(data); if (files.isEmpty()) { if (data->hasImage()) {