aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/leaving.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/leaving.cpp')
-rw-r--r--lib/csapi/leaving.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/csapi/leaving.cpp b/lib/csapi/leaving.cpp
index 8bd170bf..f4c5f120 100644
--- a/lib/csapi/leaving.cpp
+++ b/lib/csapi/leaving.cpp
@@ -8,18 +8,15 @@
using namespace Quotient;
-QUrl LeaveRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId)
-{
- return BaseJob::makeRequestUrl(std::move(baseUrl),
- QStringLiteral("/_matrix/client/r0")
- % "/rooms/" % roomId % "/leave");
-}
-
-LeaveRoomJob::LeaveRoomJob(const QString& roomId)
+LeaveRoomJob::LeaveRoomJob(const QString& roomId, const QString& reason)
: BaseJob(HttpVerb::Post, QStringLiteral("LeaveRoomJob"),
QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId
% "/leave")
-{}
+{
+ QJsonObject _data;
+ addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason);
+ setRequestData(std::move(_data));
+}
QUrl ForgetRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId)
{