diff options
Diffstat (limited to 'lib/csapi/kicking.cpp')
-rw-r--r-- | lib/csapi/kicking.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/lib/csapi/kicking.cpp b/lib/csapi/kicking.cpp index 1d6d5543..4ca39c4c 100644 --- a/lib/csapi/kicking.cpp +++ b/lib/csapi/kicking.cpp @@ -4,23 +4,15 @@ #include "kicking.h" -#include "converters.h" +using namespace Quotient; -#include <QtCore/QStringBuilder> - -using namespace QMatrixClient; - -static const auto basePath = QStringLiteral("/_matrix/client/r0"); - -static const auto KickJobName = QStringLiteral("KickJob"); - -KickJob::KickJob(const QString& roomId, const QString& userId, const QString& reason) - : BaseJob(HttpVerb::Post, KickJobName, - basePath % "/rooms/" % roomId % "/kick") +KickJob::KickJob(const QString& roomId, const QString& userId, + const QString& reason) + : BaseJob(HttpVerb::Post, QStringLiteral("KickJob"), + makePath("/_matrix/client/v3", "/rooms/", roomId, "/kick")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("user_id"), userId); - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(_data); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("user_id"), userId); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); } - |