aboutsummaryrefslogtreecommitdiff
path: root/lib/identity/definitions/request_email_validation.cpp
diff options
context:
space:
mode:
authorHubert Chathi <uhoreg@debian.org>2019-06-25 16:33:24 -0400
committerHubert Chathi <uhoreg@debian.org>2019-06-25 16:33:24 -0400
commit72d5660efd0755bb53a8699cd39865155400d288 (patch)
treeed7e7537e6a3eb7e8b92226c4015f9bfc8e11c5a /lib/identity/definitions/request_email_validation.cpp
parent52407a933bfe1fcc5f3aa1dccaa0b9a8279aa634 (diff)
parent681203f951d13e9e8eaf772435cac28c6d74cd42 (diff)
downloadlibquotient-72d5660efd0755bb53a8699cd39865155400d288.tar.gz
libquotient-72d5660efd0755bb53a8699cd39865155400d288.zip
Merge branch 'upstream' (v0.5.2)
Diffstat (limited to 'lib/identity/definitions/request_email_validation.cpp')
-rw-r--r--lib/identity/definitions/request_email_validation.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/lib/identity/definitions/request_email_validation.cpp b/lib/identity/definitions/request_email_validation.cpp
index 95088bcb..47463a8b 100644
--- a/lib/identity/definitions/request_email_validation.cpp
+++ b/lib/identity/definitions/request_email_validation.cpp
@@ -6,28 +6,21 @@
using namespace QMatrixClient;
-QJsonObject QMatrixClient::toJson(const RequestEmailValidation& pod)
+void JsonObjectConverter<RequestEmailValidation>::dumpTo(
+ QJsonObject& jo, const RequestEmailValidation& pod)
{
- QJsonObject jo;
addParam<>(jo, QStringLiteral("client_secret"), pod.clientSecret);
addParam<>(jo, QStringLiteral("email"), pod.email);
addParam<>(jo, QStringLiteral("send_attempt"), pod.sendAttempt);
addParam<IfNotEmpty>(jo, QStringLiteral("next_link"), pod.nextLink);
- return jo;
}
-RequestEmailValidation FromJsonObject<RequestEmailValidation>::operator()(const QJsonObject& jo) const
+void JsonObjectConverter<RequestEmailValidation>::fillFrom(
+ const QJsonObject& jo, RequestEmailValidation& result)
{
- RequestEmailValidation result;
- result.clientSecret =
- fromJson<QString>(jo.value("client_secret"_ls));
- result.email =
- fromJson<QString>(jo.value("email"_ls));
- result.sendAttempt =
- fromJson<int>(jo.value("send_attempt"_ls));
- result.nextLink =
- fromJson<QString>(jo.value("next_link"_ls));
-
- return result;
+ fromJson(jo.value("client_secret"_ls), result.clientSecret);
+ fromJson(jo.value("email"_ls), result.email);
+ fromJson(jo.value("send_attempt"_ls), result.sendAttempt);
+ fromJson(jo.value("next_link"_ls), result.nextLink);
}