diff options
Diffstat (limited to 'jobs/generated/banning.cpp')
-rw-r--r-- | jobs/generated/banning.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/jobs/generated/banning.cpp b/jobs/generated/banning.cpp index c47d3419..ebb4c96c 100644 --- a/jobs/generated/banning.cpp +++ b/jobs/generated/banning.cpp @@ -15,21 +15,24 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0"); BanJob::BanJob(QString roomId, QString user_id, QString reason) : BaseJob(HttpVerb::Post, "BanJob", basePath % "/rooms/" % roomId % "/ban", - Query { }, - Data { - { "user_id", toJson(user_id) }, - { "reason", toJson(reason) } - } + Query { } ) -{ } +{ + Data _data; + _data.insert("user_id", toJson(user_id)); + if (!reason.isEmpty()) + _data.insert("reason", toJson(reason)); + setRequestData(_data); +} UnbanJob::UnbanJob(QString roomId, QString user_id) : BaseJob(HttpVerb::Post, "UnbanJob", basePath % "/rooms/" % roomId % "/unban", - Query { }, - Data { - { "user_id", toJson(user_id) } - } + Query { } ) -{ } +{ + Data _data; + _data.insert("user_id", toJson(user_id)); + setRequestData(_data); +} |