Send encrypted files as generic mimetype and actually set url

This commit is contained in:
Nicolas Werner 2019-12-12 23:03:31 +01:00
parent c4541d08ed
commit 31b00c445b
2 changed files with 6 additions and 3 deletions

4
deps/CMakeLists.txt vendored
View file

@ -46,10 +46,10 @@ set(BOOST_SHA256
set( set(
MTXCLIENT_URL MTXCLIENT_URL
https://github.com/Nheko-Reborn/mtxclient/archive/64182a84e35378113f7d3a80f3073894416480e7.zip https://github.com/Nheko-Reborn/mtxclient/archive/1945952864ef87a6afeb57b0beb80756d0647381.zip
) )
set(MTXCLIENT_HASH set(MTXCLIENT_HASH
c9973501920046f04c72983472451736343d00e7a40f4d4a12181191093a5fab) 727cd145c0c1e9c168aaeded3b7cc9801c63b4da5e8cd0a4782982d08770816e)
set( set(
TWEENY_URL TWEENY_URL
https://github.com/mobius3/tweeny/archive/b94ce07cfb02a0eb8ac8aaf66137dabdaea857cf.tar.gz https://github.com/mobius3/tweeny/archive/b94ce07cfb02a0eb8ac8aaf66137dabdaea857cf.tar.gz

View file

@ -331,7 +331,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
http::client()->upload( http::client()->upload(
payload, payload,
mime.name().toStdString(), encryptedFile ? "application/octet-stream" : mime.name().toStdString(),
QFileInfo(fn).fileName().toStdString(), QFileInfo(fn).fileName().toStdString(),
[this, [this,
room_id = current_room_, room_id = current_room_,
@ -379,6 +379,9 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
QSize dimensions) { QSize dimensions) {
text_input_->hideUploadSpinner(); text_input_->hideUploadSpinner();
if (encryptedFile)
encryptedFile->url = url.toStdString();
if (mimeClass == "image") if (mimeClass == "image")
view_manager_->queueImageMessage( view_manager_->queueImageMessage(
roomid, filename, encryptedFile, url, mime, dsize, dimensions); roomid, filename, encryptedFile, url, mime, dsize, dimensions);