[network/ruqola] src/core/messages: Continue to implement messageencrypted

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 801d9652d976b2c3388475b4efd1743455bb058e by Laurent Montel.
Committed on 03/08/2026 at 11:35.
Pushed by mlaurent into branch 'master'.

Continue to implement messageencrypted

M  +45   -3    src/core/messages/messageencrypted.cpp
M  +18   -0    src/core/messages/messageencrypted.h

https://invent.kde.org/network/ruqola/-/commit/801d9652d976b2c3388475b4efd1743455bb058e

diff --git a/src/core/messages/messageencrypted.cpp b/src/core/messages/messageencrypted.cpp
index 68fc299db1..e2fd19d29b 100644
--- a/src/core/messages/messageencrypted.cpp
+++ b/src/core/messages/messageencrypted.cpp
@@ -33,10 +33,49 @@ bool MessageEncrypted::isValid() const
     // return !mPinnedBy.isEmpty();
 }
 
+QByteArray MessageEncrypted::algorithm() const
+{
+    return mAlgorithm;
+}
+
+void MessageEncrypted::setAlgorithm(const QByteArray &newAlgorithm)
+{
+    mAlgorithm = newAlgorithm;
+}
+
+QString MessageEncrypted::ciphertext() const
+{
+    return mCiphertext;
+}
+
+void MessageEncrypted::setCiphertext(const QString &newCiphertext)
+{
+    mCiphertext = newCiphertext;
+}
+
+QByteArray MessageEncrypted::keyId() const
+{
+    return mKeyId;
+}
+
+void MessageEncrypted::setKeyId(const QByteArray &newKeyId)
+{
+    mKeyId = newKeyId;
+}
+
+QByteArray MessageEncrypted::iv() const
+{
+    return mIv;
+}
+
+void MessageEncrypted::setIv(const QByteArray &newIv)
+{
+    mIv = newIv;
+}
+
 bool MessageEncrypted::operator==(const MessageEncrypted &other) const
 {
-    // TODO
-    return false;
+    return mAlgorithm == other.algorithm() && mCiphertext == other.ciphertext() && mKeyId == other.keyId() && mIv == other.iv();
 }
 
 void MessageEncrypted::parse(const QJsonObject &o)
@@ -53,7 +92,10 @@ QJsonObject MessageEncrypted::serialize(const MessageEncrypted &messagePinned)
 
 QDebug operator<<(QDebug d, const MessageEncrypted &t)
 {
-    // TODO
+    d.space() << "algorithm:" << t.algorithm();
+    d.space() << "ciphertext:" << t.ciphertext();
+    d.space() << "keyId:" << t.keyId();
+    d.space() << "iv:" << t.iv();
     return d;
 }
 
diff --git a/src/core/messages/messageencrypted.h b/src/core/messages/messageencrypted.h
index 24ae18c642..10ac881fdf 100644
--- a/src/core/messages/messageencrypted.h
+++ b/src/core/messages/messageencrypted.h
@@ -25,5 +25,23 @@ public:
     [[nodiscard]] static MessageEncrypted *deserialize(const QJsonObject &o);
 
     [[nodiscard]] bool isValid() const;
+
+    [[nodiscard]] QByteArray algorithm() const;
+    void setAlgorithm(const QByteArray &newAlgorithm);
+
+    [[nodiscard]] QString ciphertext() const;
+    void setCiphertext(const QString &newCiphertext);
+
+    [[nodiscard]] QByteArray keyId() const;
+    void setKeyId(const QByteArray &newKeyId);
+
+    [[nodiscard]] QByteArray iv() const;
+    void setIv(const QByteArray &newIv);
+
+private:
+    QByteArray mAlgorithm;
+    QByteArray mKeyId;
+    QString mCiphertext; // TODO QByteArray ?
+    QByteArray mIv;
 };
 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const MessageEncrypted &t);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.