From a105f344f4ccc674d3e2339cc72ca215c44b61ca Mon Sep 17 00:00:00 2001 From: Black Hat Date: Sun, 29 Jul 2018 21:46:57 +0800 Subject: [PATCH] Update libqmatrixclient && fix file posting caused by upstream change. --- include/libqmatrixclient | 2 +- src/controller.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/libqmatrixclient b/include/libqmatrixclient index cbb8c1bf4..941cfdf8b 160000 --- a/include/libqmatrixclient +++ b/include/libqmatrixclient @@ -1 +1 @@ -Subproject commit cbb8c1bf4e33639d8a00341021542de99bd6bce2 +Subproject commit 941cfdf8b591bf14002f28e99e06c200dc5bcc84 diff --git a/src/controller.cpp b/src/controller.cpp index 4bce1b4b6..f3ef037cc 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -84,11 +84,11 @@ void Controller::postFile(QMatrixClient::Room* room, const QUrl& localFile, if (mime.startsWith("image")) msgType = "m.image"; if (mime.startsWith("video")) msgType = "m.video"; if (mime.startsWith("audio")) msgType = "m.audio"; - QJsonObject json{{"content", QJsonObject{{"msgtype", msgType}, - {"body", fileName}, - {"filename", fileName}, - {"url", mxcUrl.url()}}}}; - room->postMessage(QMatrixClient::RoomMessageEvent(json)); + QJsonObject json{QJsonObject{{"msgtype", msgType}, + {"body", fileName}, + {"filename", fileName}, + {"url", mxcUrl.url()}}}; + room->postMessage("m.room.message", json); } QString Controller::getMIME(const QUrl& fileUrl) const {