aboutsummaryrefslogtreecommitdiff
path: root/lib/events/encryptedevent.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-11-26 13:46:58 +0100
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-11-26 13:46:58 +0100
commitf4a0acf818c4c89d132b2ec96d47c5817b106149 (patch)
treea76625dce0ce620a1a54f5a76978da3d290bfd0b /lib/events/encryptedevent.cpp
parentf6155d62740a88b020273ba623c816f7b9805772 (diff)
downloadlibquotient-f4a0acf818c4c89d132b2ec96d47c5817b106149.tar.gz
libquotient-f4a0acf818c4c89d132b2ec96d47c5817b106149.zip
Drop #include "logging.h" from event.h
Makes compilation a tad lighter.
Diffstat (limited to 'lib/events/encryptedevent.cpp')
-rw-r--r--lib/events/encryptedevent.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/events/encryptedevent.cpp b/lib/events/encryptedevent.cpp
index 0290f973..ebf733ac 100644
--- a/lib/events/encryptedevent.cpp
+++ b/lib/events/encryptedevent.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "encryptedevent.h"
+#include "logging.h"
using namespace Quotient;
@@ -25,8 +26,12 @@ EncryptedEvent::EncryptedEvent(QByteArray ciphertext, const QString& senderKey,
})
{}
-EncryptedEvent::EncryptedEvent(const QJsonObject& obj)
- : RoomEvent(typeId(), obj)
+QString EncryptedEvent::algorithm() const
{
- qCDebug(E2EE) << "Encrypted event from" << senderId();
+ const auto algo = content<QString>(AlgorithmKeyL);
+ if (!SupportedAlgorithms.contains(algo)) {
+ qCWarning(MAIN) << "The EncryptedEvent's algorithm" << algo
+ << "is not supported";
+ }
+ return algo;
}