aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/joining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/joining.cpp')
-rw-r--r--lib/csapi/joining.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/csapi/joining.cpp b/lib/csapi/joining.cpp
index 4761e949..998d0b42 100644
--- a/lib/csapi/joining.cpp
+++ b/lib/csapi/joining.cpp
@@ -9,13 +9,15 @@
using namespace Quotient;
JoinRoomByIdJob::JoinRoomByIdJob(
- const QString& roomId, const Omittable<ThirdPartySigned>& thirdPartySigned)
+ const QString& roomId, const Omittable<ThirdPartySigned>& thirdPartySigned,
+ const QString& reason)
: BaseJob(HttpVerb::Post, QStringLiteral("JoinRoomByIdJob"),
QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId % "/join")
{
QJsonObject _data;
addParam<IfNotEmpty>(_data, QStringLiteral("third_party_signed"),
thirdPartySigned);
+ addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason);
setRequestData(std::move(_data));
addExpectedKey("room_id");
}
@@ -29,7 +31,8 @@ auto queryToJoinRoom(const QStringList& serverName)
JoinRoomJob::JoinRoomJob(const QString& roomIdOrAlias,
const QStringList& serverName,
- const Omittable<ThirdPartySigned>& thirdPartySigned)
+ const Omittable<ThirdPartySigned>& thirdPartySigned,
+ const QString& reason)
: BaseJob(HttpVerb::Post, QStringLiteral("JoinRoomJob"),
QStringLiteral("/_matrix/client/r0") % "/join/" % roomIdOrAlias,
queryToJoinRoom(serverName))
@@ -37,6 +40,7 @@ JoinRoomJob::JoinRoomJob(const QString& roomIdOrAlias,
QJsonObject _data;
addParam<IfNotEmpty>(_data, QStringLiteral("third_party_signed"),
thirdPartySigned);
+ addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason);
setRequestData(std::move(_data));
addExpectedKey("room_id");
}