aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/inviting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/inviting.cpp')
-rw-r--r--lib/csapi/inviting.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/csapi/inviting.cpp b/lib/csapi/inviting.cpp
index 01620f9e..41a8b5be 100644
--- a/lib/csapi/inviting.cpp
+++ b/lib/csapi/inviting.cpp
@@ -4,16 +4,15 @@
#include "inviting.h"
-#include <QtCore/QStringBuilder>
-
using namespace Quotient;
-InviteUserJob::InviteUserJob(const QString& roomId, const QString& userId)
+InviteUserJob::InviteUserJob(const QString& roomId, const QString& userId,
+ const QString& reason)
: BaseJob(HttpVerb::Post, QStringLiteral("InviteUserJob"),
- QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId
- % "/invite")
+ makePath("/_matrix/client/v3", "/rooms/", roomId, "/invite"))
{
- QJsonObject _data;
- addParam<>(_data, QStringLiteral("user_id"), userId);
- setRequestData(std::move(_data));
+ QJsonObject _dataJson;
+ addParam<>(_dataJson, QStringLiteral("user_id"), userId);
+ addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason);
+ setRequestData({ _dataJson });
}