diff options
Diffstat (limited to 'lib/csapi/report_content.cpp')
-rw-r--r-- | lib/csapi/report_content.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/csapi/report_content.cpp b/lib/csapi/report_content.cpp index 0a41625f..bc52208f 100644 --- a/lib/csapi/report_content.cpp +++ b/lib/csapi/report_content.cpp @@ -4,18 +4,16 @@ #include "report_content.h" -#include <QtCore/QStringBuilder> - using namespace Quotient; ReportContentJob::ReportContentJob(const QString& roomId, const QString& eventId, - int score, const QString& reason) + Omittable<int> score, const QString& reason) : BaseJob(HttpVerb::Post, QStringLiteral("ReportContentJob"), - QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId - % "/report/" % eventId) + makePath("/_matrix/client/v3", "/rooms/", roomId, "/report/", + eventId)) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("score"), score); - addParam<>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("score"), score); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); } |