diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-26 16:07:25 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-26 16:07:25 +0100 |
commit | 4ba795556721a88d2ac258d9095a46de21d77011 (patch) | |
tree | c3595ccc6a6f861d7fe91e6bcd25e74f4626adb3 /lib/events/encryptedevent.h | |
parent | b3d62050befbb1c526f03e4356f3263d197c45f2 (diff) | |
download | libquotient-4ba795556721a88d2ac258d9095a46de21d77011.tar.gz libquotient-4ba795556721a88d2ac258d9095a46de21d77011.zip |
Revert "Drop #include "logging.h" from event.h"
Doesn't really help build times, instead breaking the build on older Qt.
Diffstat (limited to 'lib/events/encryptedevent.h')
-rw-r--r-- | lib/events/encryptedevent.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/events/encryptedevent.h b/lib/events/encryptedevent.h index d2b71785..598829cd 100644 --- a/lib/events/encryptedevent.h +++ b/lib/events/encryptedevent.h @@ -37,11 +37,17 @@ public: /* In case with Megolm, device_id and session_id are required */ explicit EncryptedEvent(QByteArray ciphertext, const QString& senderKey, const QString& deviceId, const QString& sessionId); - explicit EncryptedEvent(const QJsonObject& obj) - : RoomEvent(typeId(), obj) - {} + explicit EncryptedEvent(const QJsonObject& obj); - QString algorithm() const; + QString algorithm() const + { + QString algo = content<QString>(AlgorithmKeyL); + if (!SupportedAlgorithms.contains(algo)) { + qWarning(MAIN) << "The EncryptedEvent's algorithm" << algo + << "is not supported"; + } + return algo; + } QByteArray ciphertext() const { return content<QString>(CiphertextKeyL).toLatin1(); |