aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/login.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-08-25 22:40:15 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-08-25 22:40:15 +0900
commitd9ff200ff62fb7f5b6b51082dc3979d5454a1bec (patch)
tree16f33987a6e98646b462d22ca9f69884a9e01ee6 /lib/csapi/login.cpp
parente507ca582b1b243ee4422a4a3e0b11b28697cb16 (diff)
downloadlibquotient-d9ff200ff62fb7f5b6b51082dc3979d5454a1bec.tar.gz
libquotient-d9ff200ff62fb7f5b6b51082dc3979d5454a1bec.zip
Update to the recent CS API (watch out for breakage)
Breaking changes: * guest_can_join is no more a thing - neither in Connection::createRoom, nor even in CreateRoomJob (it turned out that Synapse didn't really process this flag); * LoginJob has changed its list of arguments. If you use Connection to do logins (and you really should), you shouldn't be affected. * GetPublicRoomsJob now returns PublicRoomsResponse instead of providing all the response parts within the job Watch other changes in the diff.
Diffstat (limited to 'lib/csapi/login.cpp')
-rw-r--r--lib/csapi/login.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/csapi/login.cpp b/lib/csapi/login.cpp
index 3956a1c4..363b6037 100644
--- a/lib/csapi/login.cpp
+++ b/lib/csapi/login.cpp
@@ -76,20 +76,21 @@ class LoginJob::Private
static const auto LoginJobName = QStringLiteral("LoginJob");
-LoginJob::LoginJob(const QString& type, const QString& user, const QString& medium, const QString& address, const QString& password, const QString& token, const QString& deviceId, const QString& initialDeviceDisplayName)
+LoginJob::LoginJob(const QString& type, const Omittable<UserIdentifier>& identifier, const QString& password, const QString& token, const QString& deviceId, const QString& initialDeviceDisplayName, const QString& user, const QString& medium, const QString& address)
: BaseJob(HttpVerb::Post, LoginJobName,
basePath % "/login", false)
, d(new Private)
{
QJsonObject _data;
addParam<>(_data, QStringLiteral("type"), type);
- addParam<IfNotEmpty>(_data, QStringLiteral("user"), user);
- addParam<IfNotEmpty>(_data, QStringLiteral("medium"), medium);
- addParam<IfNotEmpty>(_data, QStringLiteral("address"), address);
+ addParam<IfNotEmpty>(_data, QStringLiteral("identifier"), identifier);
addParam<IfNotEmpty>(_data, QStringLiteral("password"), password);
addParam<IfNotEmpty>(_data, QStringLiteral("token"), token);
addParam<IfNotEmpty>(_data, QStringLiteral("device_id"), deviceId);
addParam<IfNotEmpty>(_data, QStringLiteral("initial_device_display_name"), initialDeviceDisplayName);
+ addParam<IfNotEmpty>(_data, QStringLiteral("user"), user);
+ addParam<IfNotEmpty>(_data, QStringLiteral("medium"), medium);
+ addParam<IfNotEmpty>(_data, QStringLiteral("address"), address);
setRequestData(_data);
}