summary refs log tree commit diff
path: root/src/ChatPage.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2019-12-12 23:03:31 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2019-12-12 23:17:17 +0100
commit31b00c445b41c578c9c91f4df964b4bd90535108 (patch)
tree6c8b417e3009d6675f74c1de26b799adf690baca /src/ChatPage.cpp
parentcache .deps directory in appveyor (diff)
downloadnheko-31b00c445b41c578c9c91f4df964b4bd90535108.tar.xz
Send encrypted files as generic mimetype and actually set url
Diffstat (limited to 'src/ChatPage.cpp')
-rw-r--r--src/ChatPage.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp
index d6f6940b..35d262ac 100644
--- a/src/ChatPage.cpp
+++ b/src/ChatPage.cpp
@@ -331,7 +331,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
 
                   http::client()->upload(
                     payload,
-                    mime.name().toStdString(),
+                    encryptedFile ? "application/octet-stream" : mime.name().toStdString(),
                     QFileInfo(fn).fileName().toStdString(),
                     [this,
                      room_id  = current_room_,
@@ -379,6 +379,9 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
                        QSize dimensions) {
                         text_input_->hideUploadSpinner();
 
+                        if (encryptedFile)
+                                encryptedFile->url = url.toStdString();
+
                         if (mimeClass == "image")
                                 view_manager_->queueImageMessage(
                                   roomid, filename, encryptedFile, url, mime, dsize, dimensions);