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/device_keys.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'lib/csapi/definitions/device_keys.h') diff --git a/lib/csapi/definitions/device_keys.h b/lib/csapi/definitions/device_keys.h index 8ebe1125..6c417ce7 100644 --- a/lib/csapi/definitions/device_keys.h +++ b/lib/csapi/definitions/device_keys.h @@ -8,18 +8,16 @@ #include -namespace QMatrixClient -{ +namespace QMatrixClient { // Data structures /// Device identity keys - struct DeviceKeys - { - /// The ID of the user the device belongs to. Must match the user ID used - /// when logging in. + struct DeviceKeys { + /// The ID of the user the device belongs to. Must match the user ID + /// used when logging in. QString userId; - /// The ID of the device these keys belong to. Must match the device ID used - /// when logging in. + /// The ID of the device these keys belong to. Must match the device ID + /// used when logging in. QString deviceId; /// The encryption algorithms supported by this device. QStringList algorithms; @@ -27,15 +25,15 @@ namespace QMatrixClient /// format ``:``. The keys themselves should be /// encoded as specified by the key algorithm. QHash keys; - /// Signatures for the device key object. A map from user ID, to a map from + /// Signatures for the device key object. A map from user ID, to a map + /// from /// ``:`` to the signature. - /// + /// /// The signature is calculated using the process described at `Signing /// JSON`_. QHash> signatures; }; - template <> struct JsonObjectConverter - { + template <> struct JsonObjectConverter { static void dumpTo(QJsonObject& jo, const DeviceKeys& pod); static void fillFrom(const QJsonObject& jo, DeviceKeys& 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/device_keys.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'lib/csapi/definitions/device_keys.h') diff --git a/lib/csapi/definitions/device_keys.h b/lib/csapi/definitions/device_keys.h index c86db46a..6bd96584 100644 --- a/lib/csapi/definitions/device_keys.h +++ b/lib/csapi/definitions/device_keys.h @@ -4,8 +4,6 @@ #pragma once - - #include "converters.h" #include @@ -18,25 +16,29 @@ namespace QMatrixClient /// Device identity keys struct DeviceKeys { - /// The ID of the user the device belongs to. Must match the user ID usedwhen logging in. + /// The ID of the user the device belongs to. Must match the user ID + /// usedwhen logging in. QString userId; - /// The ID of the device these keys belong to. Must match the device ID usedwhen logging in. + /// The ID of the device these keys belong to. Must match the device ID + /// usedwhen logging in. QString deviceId; /// The encryption algorithms supported by this device. QStringList algorithms; - /// Public identity keys. The names of the properties should be in theformat ``:``. The keys themselves should beencoded as specified by the key algorithm. + /// Public identity keys. The names of the properties should be in theformat + /// ``:``. The keys themselves should beencoded as + /// specified by the key algorithm. QHash keys; - /// Signatures for the device key object. A map from user ID, to a map from``:`` to the signature.The signature is calculated using the process described at `SigningJSON`_. + /// Signatures for the device key object. A map from user ID, to a map + /// from``:`` to the signature.The signature is + /// calculated using the process described at `SigningJSON`_. QHash> signatures; - - }; -template <> struct JsonObjectConverter +template <> +struct JsonObjectConverter { static void dumpTo(QJsonObject& jo, const DeviceKeys& pod); - static void fillFrom(const QJsonObject& jo, DeviceKeys& pod);}; - - + static void fillFrom(const QJsonObject& jo, DeviceKeys& 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/device_keys.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/csapi/definitions/device_keys.h') diff --git a/lib/csapi/definitions/device_keys.h b/lib/csapi/definitions/device_keys.h index 6bd96584..d1d8abef 100644 --- a/lib/csapi/definitions/device_keys.h +++ b/lib/csapi/definitions/device_keys.h @@ -8,7 +8,7 @@ #include -namespace QMatrixClient +namespace Quotient { // Data structures @@ -41,4 +41,4 @@ struct JsonObjectConverter static void fillFrom(const QJsonObject& jo, DeviceKeys& 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/device_keys.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'lib/csapi/definitions/device_keys.h') diff --git a/lib/csapi/definitions/device_keys.h b/lib/csapi/definitions/device_keys.h index d1d8abef..a067b4f3 100644 --- a/lib/csapi/definitions/device_keys.h +++ b/lib/csapi/definitions/device_keys.h @@ -8,35 +8,38 @@ #include -namespace Quotient -{ +namespace Quotient { // Data structures /// Device identity keys -struct DeviceKeys -{ - /// The ID of the user the device belongs to. Must match the user ID - /// usedwhen logging in. +struct DeviceKeys { + /// The ID of the user the device belongs to. Must match the user ID used + /// when logging in. QString userId; - /// The ID of the device these keys belong to. Must match the device ID - /// usedwhen logging in. + + /// The ID of the device these keys belong to. Must match the device ID used + /// when logging in. QString deviceId; + /// The encryption algorithms supported by this device. QStringList algorithms; - /// Public identity keys. The names of the properties should be in theformat - /// ``:``. The keys themselves should beencoded as - /// specified by the key algorithm. + + /// Public identity keys. The names of the properties should be in the + /// format ``:``. The keys themselves should be + /// encoded as specified by the key algorithm. QHash keys; - /// Signatures for the device key object. A map from user ID, to a map - /// from``:`` to the signature.The signature is - /// calculated using the process described at `SigningJSON`_. + + /// Signatures for the device key object. A map from user ID, to a map from + /// ``:`` to the signature. + /// + /// The signature is calculated using the process described at `Signing + /// JSON`_. QHash> signatures; }; template <> -struct JsonObjectConverter -{ +struct JsonObjectConverter { static void dumpTo(QJsonObject& jo, const DeviceKeys& pod); static void fillFrom(const QJsonObject& jo, DeviceKeys& 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/device_keys.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'lib/csapi/definitions/device_keys.h') diff --git a/lib/csapi/definitions/device_keys.h b/lib/csapi/definitions/device_keys.h index a067b4f3..3065f218 100644 --- a/lib/csapi/definitions/device_keys.h +++ b/lib/csapi/definitions/device_keys.h @@ -6,12 +6,7 @@ #include "converters.h" -#include - namespace Quotient { - -// Data structures - /// Device identity keys struct DeviceKeys { /// The ID of the user the device belongs to. Must match the user ID used @@ -40,8 +35,22 @@ struct DeviceKeys { template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const DeviceKeys& pod); - static void fillFrom(const QJsonObject& jo, DeviceKeys& pod); + static void dumpTo(QJsonObject& jo, const DeviceKeys& pod) + { + addParam<>(jo, QStringLiteral("user_id"), pod.userId); + addParam<>(jo, QStringLiteral("device_id"), pod.deviceId); + addParam<>(jo, QStringLiteral("algorithms"), pod.algorithms); + addParam<>(jo, QStringLiteral("keys"), pod.keys); + addParam<>(jo, QStringLiteral("signatures"), pod.signatures); + } + static void fillFrom(const QJsonObject& jo, DeviceKeys& pod) + { + fromJson(jo.value("user_id"_ls), pod.userId); + fromJson(jo.value("device_id"_ls), pod.deviceId); + fromJson(jo.value("algorithms"_ls), pod.algorithms); + fromJson(jo.value("keys"_ls), pod.keys); + fromJson(jo.value("signatures"_ls), pod.signatures); + } }; } // namespace Quotient -- cgit v1.2.3