diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-02-27 09:36:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-27 09:36:37 +0100 |
commit | 8871fd723382d1a19e8e29b2877f70151bf8e8a1 (patch) | |
tree | 6f255ef15b9c94f4a36ce1efd0c2efaac178c1d0 | |
parent | bb04635c6bc9e051f4bba311aafeb0b0d355f7f5 (diff) | |
parent | 29510632780f695eefc9d5107e223aa02caac2c6 (diff) | |
download | libquotient-8871fd723382d1a19e8e29b2877f70151bf8e8a1.tar.gz libquotient-8871fd723382d1a19e8e29b2877f70151bf8e8a1.zip |
Merge #536: Use QOlmMessage::Type in more places
-rw-r--r-- | lib/connection.cpp | 4 | ||||
-rw-r--r-- | lib/e2ee/qolmmessage.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 7099c59c..b585fcc6 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -274,10 +274,10 @@ public: QString decrypted; int type = personalCipherObject.value(TypeKeyL).toInt(-1); QByteArray body = personalCipherObject.value(BodyKeyL).toString().toLatin1(); - if (type == 0) { + if (type == QOlmMessage::PreKey) { QOlmMessage preKeyMessage(body, QOlmMessage::PreKey); decrypted = sessionDecryptPrekey(preKeyMessage, senderKey, account); - } else if (type == 1) { + } else if (type == QOlmMessage::General) { QOlmMessage message(body, QOlmMessage::General); decrypted = sessionDecryptGeneral(message, senderKey); } diff --git a/lib/e2ee/qolmmessage.h b/lib/e2ee/qolmmessage.h index 5d5db636..b4285a93 100644 --- a/lib/e2ee/qolmmessage.h +++ b/lib/e2ee/qolmmessage.h @@ -22,8 +22,8 @@ class QUOTIENT_API QOlmMessage : public QByteArray { Q_GADGET public: enum Type { + PreKey = 0, General, - PreKey, }; Q_ENUM(Type) |