diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-09-03 19:12:42 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-09-04 18:42:11 +0200 |
commit | 80499cc7619bb857c284e6e89db728ccee9c61f6 (patch) | |
tree | 5405d7ed5f6128157a2e39de0c8621141f490831 /lib/events | |
parent | 3fa9afc796788e0c7f44db15c21a5ba1294d3b2d (diff) | |
download | libquotient-80499cc7619bb857c284e6e89db728ccee9c61f6.tar.gz libquotient-80499cc7619bb857c284e6e89db728ccee9c61f6.zip |
More cleanup
Diffstat (limited to 'lib/events')
-rw-r--r-- | lib/events/encryptedevent.cpp | 7 | ||||
-rw-r--r-- | lib/events/encryptedevent.h | 7 | ||||
-rw-r--r-- | lib/events/event.h | 2 | ||||
-rw-r--r-- | lib/events/roommessageevent.cpp | 5 |
4 files changed, 11 insertions, 10 deletions
diff --git a/lib/events/encryptedevent.cpp b/lib/events/encryptedevent.cpp index e9b4a585..94b44901 100644 --- a/lib/events/encryptedevent.cpp +++ b/lib/events/encryptedevent.cpp @@ -6,14 +6,15 @@ using namespace Quotient; -EncryptedEvent::EncryptedEvent(const QJsonObject& ciphertext, +EncryptedEvent::EncryptedEvent(const QJsonObject& ciphertexts, const QString& senderKey) : RoomEvent({ { AlgorithmKeyL, OlmV1Curve25519AesSha2AlgoKey }, - { CiphertextKeyL, ciphertext }, + { CiphertextKeyL, ciphertexts }, { SenderKeyKeyL, senderKey } }) {} -EncryptedEvent::EncryptedEvent(QByteArray ciphertext, const QString& senderKey, +EncryptedEvent::EncryptedEvent(const QByteArray& ciphertext, + const QString& senderKey, const QString& deviceId, const QString& sessionId) : RoomEvent({ { AlgorithmKeyL, MegolmV1AesSha2AlgoKey }, diff --git a/lib/events/encryptedevent.h b/lib/events/encryptedevent.h index 22e51cb8..02d4c7aa 100644 --- a/lib/events/encryptedevent.h +++ b/lib/events/encryptedevent.h @@ -32,11 +32,12 @@ public: /* In case with Olm, the encrypted content of the event is * a map from the recipient Curve25519 identity key to ciphertext * information */ - explicit EncryptedEvent(const QJsonObject& ciphertext, + explicit EncryptedEvent(const QJsonObject& ciphertexts, const QString& senderKey); /* 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 QByteArray& ciphertext, + const QString& senderKey, const QString& deviceId, + const QString& sessionId); explicit EncryptedEvent(const QJsonObject& obj); QString algorithm() const; diff --git a/lib/events/event.h b/lib/events/event.h index 4b715813..ea5a2554 100644 --- a/lib/events/event.h +++ b/lib/events/event.h @@ -269,7 +269,7 @@ public: explicit Event(const QJsonObject& json); Q_DISABLE_COPY(Event) - Event(Event&&) = default; + Event(Event&&) noexcept = default; Event& operator=(Event&&) = delete; virtual ~Event(); diff --git a/lib/events/roommessageevent.cpp b/lib/events/roommessageevent.cpp index db5afaf1..df4840b3 100644 --- a/lib/events/roommessageevent.cpp +++ b/lib/events/roommessageevent.cpp @@ -128,9 +128,8 @@ QJsonObject RoomMessageEvent::assembleContentJson(const QString& plainBody, RoomMessageEvent::RoomMessageEvent(const QString& plainBody, const QString& jsonMsgType, TypedBase* content) - : RoomEvent(RoomEvent::basicJson(TypeId, - assembleContentJson(plainBody, jsonMsgType, - content))) + : RoomEvent( + basicJson(TypeId, assembleContentJson(plainBody, jsonMsgType, content))) , _content(content) {} |