mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Merge pull request #1388 from heejune/dev
Resolving a bug #1247 (Sending files to channels)
This commit is contained in:
@@ -4575,6 +4575,8 @@ void HistoryWidget::onDocumentSelect() {
|
|||||||
void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) {
|
void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) {
|
||||||
if (!_history) return;
|
if (!_history) return;
|
||||||
|
|
||||||
|
if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return;
|
||||||
|
|
||||||
_attachDrag = getDragState(e->mimeData());
|
_attachDrag = getDragState(e->mimeData());
|
||||||
updateDragAreas();
|
updateDragAreas();
|
||||||
|
|
||||||
@@ -4876,6 +4878,8 @@ void HistoryWidget::onPhotoDrop(const QMimeData *data) {
|
|||||||
void HistoryWidget::onDocumentDrop(const QMimeData *data) {
|
void HistoryWidget::onDocumentDrop(const QMimeData *data) {
|
||||||
if (!_history) return;
|
if (!_history) return;
|
||||||
|
|
||||||
|
if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return;
|
||||||
|
|
||||||
QStringList files = getMediasFromMime(data);
|
QStringList files = getMediasFromMime(data);
|
||||||
if (files.isEmpty()) return;
|
if (files.isEmpty()) return;
|
||||||
|
|
||||||
@@ -4883,6 +4887,9 @@ void HistoryWidget::onDocumentDrop(const QMimeData *data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::onFilesDrop(const QMimeData *data) {
|
void HistoryWidget::onFilesDrop(const QMimeData *data) {
|
||||||
|
|
||||||
|
if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return;
|
||||||
|
|
||||||
QStringList files = getMediasFromMime(data);
|
QStringList files = getMediasFromMime(data);
|
||||||
if (files.isEmpty()) {
|
if (files.isEmpty()) {
|
||||||
if (data->hasImage()) {
|
if (data->hasImage()) {
|
||||||
|
Reference in New Issue
Block a user