aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/joining.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-11 18:34:41 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-11 18:34:41 +0900
commit606db144b9ef6f1b2958ff49c4a6860bff48090c (patch)
treea9716d076722497a91ea94f6ff2281eebf205d0f /lib/csapi/joining.cpp
parent88834ea75ee3304f8ab773e05aa64ce84643f236 (diff)
downloadlibquotient-606db144b9ef6f1b2958ff49c4a6860bff48090c.tar.gz
libquotient-606db144b9ef6f1b2958ff49c4a6860bff48090c.zip
csapi: Update to the latest API definitions
Presence requires authentication; GetConfigJob; GetLoginFlowsJob; serverName parameter in JoinRoomJob.
Diffstat (limited to 'lib/csapi/joining.cpp')
-rw-r--r--lib/csapi/joining.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/csapi/joining.cpp b/lib/csapi/joining.cpp
index 0a4618af..1a29ac62 100644
--- a/lib/csapi/joining.cpp
+++ b/lib/csapi/joining.cpp
@@ -90,11 +90,19 @@ class JoinRoomJob::Private
QString roomId;
};
+BaseJob::Query queryToJoinRoom(const QStringList& serverName)
+{
+ BaseJob::Query _q;
+ addParam<IfNotEmpty>(_q, QStringLiteral("server_name"), serverName);
+ return _q;
+}
+
static const auto JoinRoomJobName = QStringLiteral("JoinRoomJob");
-JoinRoomJob::JoinRoomJob(const QString& roomIdOrAlias, const Omittable<ThirdPartySigned>& thirdPartySigned)
+JoinRoomJob::JoinRoomJob(const QString& roomIdOrAlias, const QStringList& serverName, const Omittable<ThirdPartySigned>& thirdPartySigned)
: BaseJob(HttpVerb::Post, JoinRoomJobName,
- basePath % "/join/" % roomIdOrAlias)
+ basePath % "/join/" % roomIdOrAlias,
+ queryToJoinRoom(serverName))
, d(new Private)
{
QJsonObject _data;