From aacc4bcb4a487871daae6717f77605aaba444341 Mon Sep 17 00:00:00 2001 From: Marc Deop Date: Sat, 2 Mar 2019 12:26:57 +0100 Subject: style: apply .clang-format to all .cpp and .h files --- lib/csapi/definitions/auth_data.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/csapi/definitions/auth_data.h') diff --git a/lib/csapi/definitions/auth_data.h b/lib/csapi/definitions/auth_data.h index 26eb205c..e25dff7a 100644 --- a/lib/csapi/definitions/auth_data.h +++ b/lib/csapi/definitions/auth_data.h @@ -6,16 +6,15 @@ #include "converters.h" -#include #include +#include -namespace QMatrixClient -{ +namespace QMatrixClient { // Data structures - /// Used by clients to submit authentication information to the interactive-authentication API - struct AuthenticationData - { + /// Used by clients to submit authentication information to the + /// interactive-authentication API + struct AuthenticationData { /// The login type that the client is attempting to complete. QString type; /// The value of the session key given by the homeserver. @@ -23,8 +22,7 @@ namespace QMatrixClient /// Keys dependent on the login type QHash authInfo; }; - template <> struct JsonObjectConverter - { + template <> struct JsonObjectConverter { static void dumpTo(QJsonObject& jo, const AuthenticationData& pod); static void fillFrom(QJsonObject jo, AuthenticationData& pod); }; -- cgit v1.2.3 From 9e96bc9b8dec6613e3e2f2fd564e9f6bee9bbce4 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 24 Jun 2019 07:38:50 +0900 Subject: csapi/*/**: clang-format contents of csapi subdirs as well --- lib/csapi/definitions/auth_data.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'lib/csapi/definitions/auth_data.h') diff --git a/lib/csapi/definitions/auth_data.h b/lib/csapi/definitions/auth_data.h index 689caf49..9e46812c 100644 --- a/lib/csapi/definitions/auth_data.h +++ b/lib/csapi/definitions/auth_data.h @@ -4,19 +4,18 @@ #pragma once - - #include "converters.h" -#include #include +#include namespace QMatrixClient { // Data structures -/// Used by clients to submit authentication information to the interactive-authentication API +/// Used by clients to submit authentication information to the +/// interactive-authentication API struct AuthenticationData { /// The login type that the client is attempting to complete. @@ -24,17 +23,15 @@ struct AuthenticationData /// The value of the session key given by the homeserver. QString session; - /// Keys dependent on the login type QHash authInfo; - }; -template <> struct JsonObjectConverter +template <> +struct JsonObjectConverter { static void dumpTo(QJsonObject& jo, const AuthenticationData& pod); - static void fillFrom(QJsonObject jo, AuthenticationData& pod);}; - - + static void fillFrom(QJsonObject jo, AuthenticationData& pod); +}; } // namespace QMatrixClient -- cgit v1.2.3 From 27ca32a1e5a56e09b9cc1d94224d2831004dcf3d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jul 2019 19:32:34 +0900 Subject: Namespace: QMatrixClient -> Quotient (with back comp alias) --- lib/csapi/definitions/auth_data.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/csapi/definitions/auth_data.h') diff --git a/lib/csapi/definitions/auth_data.h b/lib/csapi/definitions/auth_data.h index 9e46812c..1aeea6c2 100644 --- a/lib/csapi/definitions/auth_data.h +++ b/lib/csapi/definitions/auth_data.h @@ -9,7 +9,7 @@ #include #include -namespace QMatrixClient +namespace Quotient { // Data structures @@ -34,4 +34,4 @@ struct JsonObjectConverter static void fillFrom(QJsonObject jo, AuthenticationData& pod); }; -} // namespace QMatrixClient +} // namespace Quotient -- cgit v1.2.3 From 7036ed0dcb137cb5cbb6b426dd338c5e2e4c6424 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 17 Apr 2020 07:42:13 +0200 Subject: Regenerate API files using new GTAD and refreshed templates No functional changes. --- lib/csapi/definitions/auth_data.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/csapi/definitions/auth_data.h') diff --git a/lib/csapi/definitions/auth_data.h b/lib/csapi/definitions/auth_data.h index 1aeea6c2..e564f7f3 100644 --- a/lib/csapi/definitions/auth_data.h +++ b/lib/csapi/definitions/auth_data.h @@ -9,17 +9,16 @@ #include #include -namespace Quotient -{ +namespace Quotient { // Data structures /// Used by clients to submit authentication information to the /// interactive-authentication API -struct AuthenticationData -{ +struct AuthenticationData { /// The login type that the client is attempting to complete. QString type; + /// The value of the session key given by the homeserver. QString session; @@ -28,8 +27,7 @@ struct AuthenticationData }; template <> -struct JsonObjectConverter -{ +struct JsonObjectConverter { static void dumpTo(QJsonObject& jo, const AuthenticationData& pod); static void fillFrom(QJsonObject jo, AuthenticationData& pod); }; -- cgit v1.2.3 From 32729d9a7519cd2c4cddb0174b8329c6fd4a4a83 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jun 2020 19:46:40 +0200 Subject: Update generated files according to gtad/* changes --- lib/csapi/definitions/auth_data.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'lib/csapi/definitions/auth_data.h') diff --git a/lib/csapi/definitions/auth_data.h b/lib/csapi/definitions/auth_data.h index e564f7f3..e92596d0 100644 --- a/lib/csapi/definitions/auth_data.h +++ b/lib/csapi/definitions/auth_data.h @@ -6,13 +6,7 @@ #include "converters.h" -#include -#include - namespace Quotient { - -// Data structures - /// Used by clients to submit authentication information to the /// interactive-authentication API struct AuthenticationData { @@ -28,8 +22,18 @@ struct AuthenticationData { template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const AuthenticationData& pod); - static void fillFrom(QJsonObject jo, AuthenticationData& pod); + static void dumpTo(QJsonObject& jo, const AuthenticationData& pod) + { + fillJson(jo, pod.authInfo); + addParam<>(jo, QStringLiteral("type"), pod.type); + addParam(jo, QStringLiteral("session"), pod.session); + } + static void fillFrom(QJsonObject jo, AuthenticationData& pod) + { + fromJson(jo.take("type"_ls), pod.type); + fromJson(jo.take("session"_ls), pod.session); + fromJson(jo, pod.authInfo); + } }; } // namespace Quotient -- cgit v1.2.3