libQuotient
A Qt library for building matrix clients
qolmmessage.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2021 Alexey Andreyev <aa13q@ya.ru>
2
//
3
// SPDX-License-Identifier: LGPL-2.1-or-later
4
5
#
pragma
once
6
7
#
include
<
Quotient
/
quotient_export
.
h
>
8
9
#
include
<
QtCore
/
QByteArray
>
10
#
include
<
qobjectdefs
.
h
>
11
#
include
<
olm
/
olm
.
h
>
12
13
namespace
Quotient
{
14
15
/*! \brief A wrapper around an olm encrypted message
16
*
17
* This class encapsulates a Matrix olm encrypted message,
18
* passed in either of 2 forms: a general message or a pre-key message.
19
*
20
* The class provides functions to get a type and the ciphertext.
21
*/
22
class
QUOTIENT_API
QOlmMessage
:
public
QByteArray
{
23
Q_GADGET
24
public
:
25
enum
Type
{
26
PreKey
=
OLM_MESSAGE_TYPE_PRE_KEY
,
27
General
=
OLM_MESSAGE_TYPE_MESSAGE
,
28
};
29
Q_ENUM
(
Type
)
30
31
explicit
QOlmMessage
(
QByteArray
ciphertext
,
Type
type
=
General
);
32
33
static
QOlmMessage
fromCiphertext
(
const
QByteArray
&
ciphertext
);
34
35
Q_INVOKABLE
Type
type
()
const
;
36
Q_INVOKABLE
QByteArray
toCiphertext
()
const
;
37
38
private
:
39
Type
m_messageType
=
General
;
40
};
41
42
}
//namespace Quotient
Quotient
e2ee
qolmmessage.h
Generated by
1.9.1