aboutsummaryrefslogtreecommitdiff
path: root/lib/olm/message.cpp
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-01-27 01:43:49 +0100
committerTobias Fella <fella@posteo.de>2021-12-01 21:34:52 +0100
commitfe2d5dd577a05e4a0e250d89487cd14025204b02 (patch)
tree4c0d7c1cb68613300a01774e02a346dac334a62e /lib/olm/message.cpp
parent57a218086d3c687cd26580ee2a0d2135646411dc (diff)
downloadlibquotient-fe2d5dd577a05e4a0e250d89487cd14025204b02.tar.gz
libquotient-fe2d5dd577a05e4a0e250d89487cd14025204b02.zip
Start adding test for session stuff
Diffstat (limited to 'lib/olm/message.cpp')
-rw-r--r--lib/olm/message.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/olm/message.cpp b/lib/olm/message.cpp
index 0998a66b..634a6f0c 100644
--- a/lib/olm/message.cpp
+++ b/lib/olm/message.cpp
@@ -8,19 +8,15 @@
using namespace Quotient;
Message::Message(const QByteArray &ciphertext, Message::Type type)
- : QByteArray(std::move(ciphertext)), _messageType(type)
-{
- Q_ASSERT_X(!ciphertext.isEmpty(), "olm message", "Ciphertext is empty");
-}
-
-Message::Message(QByteArray ciphertext) : QByteArray(std::move(ciphertext))
+ : QByteArray(std::move(ciphertext))
+ , m_messageType(type)
{
Q_ASSERT_X(!ciphertext.isEmpty(), "olm message", "Ciphertext is empty");
}
Message::Type Message::type() const
{
- return _messageType;
+ return m_messageType;
}
QByteArray Message::toCiphertext() const
@@ -28,6 +24,11 @@ QByteArray Message::toCiphertext() const
return QByteArray(*this);
}
+Message Message::fromCiphertext(const QByteArray &ciphertext)
+{
+ return Message(ciphertext, Message::General);
+}
+
#endif // Quotient_E2EE_ENABLED