blob: 4803955d3e1ce10e2529bad52e53ac05abaaf88c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "keyverificationevent.h"
using namespace Quotient;
KeyVerificationRequestEvent::KeyVerificationRequestEvent(const QJsonObject &obj)
: Event(typeId(), obj)
{}
QString KeyVerificationRequestEvent::fromDevice() const
{
return contentPart<QString>("from_device"_ls);
}
QString KeyVerificationRequestEvent::transactionId() const
{
return contentPart<QString>("transaction_id"_ls);
}
QStringList KeyVerificationRequestEvent::methods() const
{
return contentPart<QStringList>("methods"_ls);
}
uint64_t KeyVerificationRequestEvent::timestamp() const
{
return contentPart<double>("timestamp"_ls);
}
KeyVerificationStartEvent::KeyVerificationStartEvent(const QJsonObject &obj)
: Event(typeId(), obj)
{}
QString KeyVerificationStartEvent::fromDevice() const
{
return contentPart<QString>("from_device"_ls);
}
QString KeyVerificationStartEvent::transactionId() const
{
return contentPart<QString>("transaction_id"_ls);
}
QString KeyVerificationStartEvent::method() const
{
return contentPart<QString>("method"_ls);
}
Omittable<QString> KeyVerificationStartEvent::nextMethod() const
{
return contentPart<Omittable<QString>>("method_ls");
}
QStringList KeyVerificationStartEvent::keyAgreementProtocols() const
{
Q_ASSERT(method() == QStringLiteral("m.sas.v1"));
return contentPart<QStringList>("key_agreement_protocols"_ls);
}
QStringList KeyVerificationStartEvent::hashes() const
{
Q_ASSERT(method() == QStringLiteral("m.sas.v1"));
return contentPart<QStringList>("hashes"_ls);
}
QStringList KeyVerificationStartEvent::messageAuthenticationCodes() const
{
Q_ASSERT(method() == QStringLiteral("m.sas.v1"));
return contentPart<QStringList>("message_authentication_codes"_ls);
}
QString KeyVerificationStartEvent::shortAuthenticationString() const
{
return contentPart<QString>("short_authentification_string"_ls);
}
KeyVerificationAcceptEvent::KeyVerificationAcceptEvent(const QJsonObject &obj)
: Event(typeId(), obj)
{}
QString KeyVerificationAcceptEvent::transactionId() const
{
return contentPart<QString>("transaction_id"_ls);
}
QString KeyVerificationAcceptEvent::method() const
{
return contentPart<QString>("method"_ls);
}
QString KeyVerificationAcceptEvent::keyAgreementProtocol() const
{
return contentPart<QString>("key_agreement_protocol"_ls);
}
QString KeyVerificationAcceptEvent::hashData() const
{
return contentPart<QString>("hash"_ls);
}
QStringList KeyVerificationAcceptEvent::shortAuthenticationString() const
{
return contentPart<QStringList>("short_authentification_string"_ls);
}
QString KeyVerificationAcceptEvent::commitement() const
{
return contentPart<QString>("commitment"_ls);
}
KeyVerificationCancelEvent::KeyVerificationCancelEvent(const QJsonObject &obj)
: Event(typeId(), obj)
{}
QString KeyVerificationCancelEvent::transactionId() const
{
return contentPart<QString>("transaction_id"_ls);
}
QString KeyVerificationCancelEvent::reason() const
{
return contentPart<QString>("reason"_ls);
}
QString KeyVerificationCancelEvent::code() const
{
return contentPart<QString>("code"_ls);
}
KeyVerificationKeyEvent::KeyVerificationKeyEvent(const QJsonObject &obj)
: Event(typeId(), obj)
{}
QString KeyVerificationKeyEvent::transactionId() const
{
return contentPart<QString>("transaction_id"_ls);
}
QString KeyVerificationKeyEvent::key() const
{
return contentPart<QString>("key"_ls);
}
KeyVerificationMacEvent::KeyVerificationMacEvent(const QJsonObject &obj)
: Event(typeId(), obj)
{}
QString KeyVerificationMacEvent::transactionId() const
{
return contentPart<QString>("transaction_id"_ls);
}
QString KeyVerificationMacEvent::keys() const
{
return contentPart<QString>("keys"_ls);
}
QHash<QString, QString> KeyVerificationMacEvent::mac() const
{
return contentPart<QHash<QString, QString>>("mac"_ls);
}
|