From 31b00c445b41c578c9c91f4df964b4bd90535108 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 12 Dec 2019 23:03:31 +0100 Subject: [PATCH] Send encrypted files as generic mimetype and actually set url --- deps/CMakeLists.txt | 4 ++-- src/ChatPage.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 0da4a671..fbe9275f 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -46,10 +46,10 @@ set(BOOST_SHA256 set( MTXCLIENT_URL - https://github.com/Nheko-Reborn/mtxclient/archive/64182a84e35378113f7d3a80f3073894416480e7.zip + https://github.com/Nheko-Reborn/mtxclient/archive/1945952864ef87a6afeb57b0beb80756d0647381.zip ) set(MTXCLIENT_HASH - c9973501920046f04c72983472451736343d00e7a40f4d4a12181191093a5fab) + 727cd145c0c1e9c168aaeded3b7cc9801c63b4da5e8cd0a4782982d08770816e) set( TWEENY_URL https://github.com/mobius3/tweeny/archive/b94ce07cfb02a0eb8ac8aaf66137dabdaea857cf.tar.gz 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, 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, 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);