diff options
author | n-peugnet <n.peugnet@free.fr> | 2022-10-06 19:27:24 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2022-10-06 19:27:24 +0200 |
commit | d911b207f49e936b3e992200796110f0749ed150 (patch) | |
tree | 96d20ebb4d074a4c1755e21cb316a52d584daee3 /lib/csapi/knocking.cpp | |
parent | 8ad8a74152c5701b6ca1f9a00487ba9257a439b4 (diff) | |
parent | 56c2f2e2b809b9077393eb617828f33d144f5634 (diff) | |
download | libquotient-d911b207f49e936b3e992200796110f0749ed150.tar.gz libquotient-d911b207f49e936b3e992200796110f0749ed150.zip |
New upstream version 0.7.0
Diffstat (limited to 'lib/csapi/knocking.cpp')
-rw-r--r-- | lib/csapi/knocking.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/csapi/knocking.cpp b/lib/csapi/knocking.cpp new file mode 100644 index 00000000..b9da4b9b --- /dev/null +++ b/lib/csapi/knocking.cpp @@ -0,0 +1,26 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#include "knocking.h" + +using namespace Quotient; + +auto queryToKnockRoom(const QStringList& serverName) +{ + QUrlQuery _q; + addParam<IfNotEmpty>(_q, QStringLiteral("server_name"), serverName); + return _q; +} + +KnockRoomJob::KnockRoomJob(const QString& roomIdOrAlias, + const QStringList& serverName, const QString& reason) + : BaseJob(HttpVerb::Post, QStringLiteral("KnockRoomJob"), + makePath("/_matrix/client/v3", "/knock/", roomIdOrAlias), + queryToKnockRoom(serverName)) +{ + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); + addExpectedKey("room_id"); +} |