diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-31 18:24:53 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-31 18:25:37 +0200 |
commit | 42811660094c88a4a1bfa8bd8ace5f4b148c246a (patch) | |
tree | 36c7c05f16f3643eaabec75d3e231c1e6bf2a61d /event-schemas/schema/core-event-schema | |
parent | fed831820965ad5654317d5e7df18c23fa75de20 (diff) | |
download | libquotient-42811660094c88a4a1bfa8bd8ace5f4b148c246a.tar.gz libquotient-42811660094c88a4a1bfa8bd8ace5f4b148c246a.zip |
Regenerate API files (FTBFS; see the next commit)
Diffstat (limited to 'event-schemas/schema/core-event-schema')
-rw-r--r-- | event-schemas/schema/core-event-schema/stripped_state.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/event-schemas/schema/core-event-schema/stripped_state.h b/event-schemas/schema/core-event-schema/stripped_state.h new file mode 100644 index 00000000..742b0a56 --- /dev/null +++ b/event-schemas/schema/core-event-schema/stripped_state.h @@ -0,0 +1,44 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#pragma once + +#include "converters.h" + +namespace Quotient { +/// A stripped down state event, with only the `type`, `state_key`, +/// `sender`, and `content` keys. +struct StrippedStateEvent { + /// The `content` for the event. + QJsonObject content; + + /// The `state_key` for the event. + QString stateKey; + + /// The `type` for the event. + QString type; + + /// The `sender` for the event. + QString sender; +}; + +template <> +struct JsonObjectConverter<StrippedStateEvent> { + static void dumpTo(QJsonObject& jo, const StrippedStateEvent& pod) + { + addParam<>(jo, QStringLiteral("content"), pod.content); + addParam<>(jo, QStringLiteral("state_key"), pod.stateKey); + addParam<>(jo, QStringLiteral("type"), pod.type); + addParam<>(jo, QStringLiteral("sender"), pod.sender); + } + static void fillFrom(const QJsonObject& jo, StrippedStateEvent& pod) + { + fromJson(jo.value("content"_ls), pod.content); + fromJson(jo.value("state_key"_ls), pod.stateKey); + fromJson(jo.value("type"_ls), pod.type); + fromJson(jo.value("sender"_ls), pod.sender); + } +}; + +} // namespace Quotient |