libQuotient
A Qt library for building matrix clients
third_party_signed.h
Go to the documentation of this file.
1 // THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
2 
3 #pragma once
4 
5 #include <Quotient/converters.h>
6 
7 namespace Quotient {
8 //! A signature of an `m.third_party_invite` token to prove that this user
9 //! owns a third-party identity which has been invited to the room.
10 struct QUOTIENT_API ThirdPartySigned {
11  //! The Matrix ID of the user who issued the invite.
12  QString sender;
13 
14  //! The Matrix ID of the invitee.
15  QString mxid;
16 
17  //! The state key of the m.third_party_invite event.
18  QString token;
19 
20  //! A signatures object containing a signature of the entire signed object.
21  QHash<QString, QHash<QString, QString>> signatures;
22 };
23 
24 template <>
25 struct JsonObjectConverter<ThirdPartySigned> {
26  static void dumpTo(QJsonObject& jo, const ThirdPartySigned& pod)
27  {
28  addParam<>(jo, "sender"_L1, pod.sender);
29  addParam<>(jo, "mxid"_L1, pod.mxid);
30  addParam<>(jo, "token"_L1, pod.token);
31  addParam<>(jo, "signatures"_L1, pod.signatures);
32  }
33  static void fillFrom(const QJsonObject& jo, ThirdPartySigned& pod)
34  {
35  fillFromJson(jo.value("sender"_L1), pod.sender);
36  fillFromJson(jo.value("mxid"_L1), pod.mxid);
37  fillFromJson(jo.value("token"_L1), pod.token);
38  fillFromJson(jo.value("signatures"_L1), pod.signatures);
39  }
40 };
41 
42 } // namespace Quotient