[network/ruqola] src/core: Prepare to react when we receive e2eRequest

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

Prepare to react when we receive e2eRequest

M  +16   -1    src/core/rocketchataccount.cpp

https://invent.kde.org/network/ruqola/-/commit/8c4915291f0865d5b633bb0cdc9c8434eccbb8ac

diff --git a/src/core/rocketchataccount.cpp b/src/core/rocketchataccount.cpp
index d110143c9d..0325b50757 100644
--- a/src/core/rocketchataccount.cpp
+++ b/src/core/rocketchataccount.cpp
@@ -2132,7 +2132,22 @@ bool RocketChatAccount::isMessageDeletable(const Message &message) const
 void RocketChatAccount::parseE2eKeyRequest(const QJsonArray &contents)
 {
     qCDebug(RUQOLA_LOG) << debugCategoryAccountName() << " RocketChatAccount::parseE2eKeyRequest(const QJsonArray &contents) " << contents;
-    qDebug() << debugCategoryAccountName() << " RocketChatAccount::parseE2eKeyRequest(const QJsonArray &contents) " << contents;
+    qDebug() << debugCategoryAccountName() << " RocketChatAccount::parseE2eKeyRequest(const QJsonArray &contents) " << contents << " count "
+             << contents.count();
+    if (contents.count() != 2) {
+        qCWarning(RUQOLA_ENCRYPTION_LOG) << debugCategoryAccountName() << "contents size != 2. It's a bug" << contents.count();
+        return;
+    }
+    const QByteArray roomId = contents.at(0).toString().toLatin1();
+    const QByteArray keyId = contents.at(1).toString().toLatin1();
+    qDebug() << debugCategoryAccountName() << " roomId : " << roomId << " keyId: " << keyId;
+
+    Room *r = mRoomModel->findRoom(roomId);
+    qDebug() << " found room " << r;
+    if (r) {
+        // TODO get encrypted room key
+    }
+
     // TODO  QJsonArray(["6a7477d083ae3ec8a9eb588f","80941e2d-96ca-4db2-852a-bbd891060dea"]) => room -> key
 }
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.