[network/ruqola] src/core: Start to implement e2ekeyRequest support

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

Start to implement e2ekeyRequest support

M  +7    -0    src/core/rocketchataccount.cpp
M  +1    -0    src/core/rocketchataccount.h
M  +12   -0    src/core/rocketchatbackend.cpp

https://invent.kde.org/network/ruqola/-/commit/e228dea914063874177c575832e84a12de614bd2

diff --git a/src/core/rocketchataccount.cpp b/src/core/rocketchataccount.cpp
index c33056e18a..d110143c9d 100644
--- a/src/core/rocketchataccount.cpp
+++ b/src/core/rocketchataccount.cpp
@@ -2129,6 +2129,13 @@ bool RocketChatAccount::isMessageDeletable(const Message &message) const
     return deleteAllowed && onTimeForDelete;
 }
 
+void RocketChatAccount::parseE2eKeyRequest(const QJsonArray &contents)
+{
+    qCDebug(RUQOLA_LOG) << debugCategoryAccountName() << " RocketChatAccount::parseE2eKeyRequest(const QJsonArray &contents) " << contents;
+    qDebug() << debugCategoryAccountName() << " RocketChatAccount::parseE2eKeyRequest(const QJsonArray &contents) " << contents;
+    // TODO  QJsonArray(["6a7477d083ae3ec8a9eb588f","80941e2d-96ca-4db2-852a-bbd891060dea"]) => room -> key
+}
+
 void RocketChatAccount::parseVideoConference(const QJsonArray &contents)
 {
     qCDebug(RUQOLA_LOG) << debugCategoryAccountName() << " RocketChatAccount::parseVideoConference(const QJsonArray &contents) " << contents;
diff --git a/src/core/rocketchataccount.h b/src/core/rocketchataccount.h
index 2ac42d65da..c982bbff70 100644
--- a/src/core/rocketchataccount.h
+++ b/src/core/rocketchataccount.h
@@ -448,6 +448,7 @@ public:
     [[nodiscard]] bool hasMessageReadReceiptActiveModule() const;
 
     void createDirectChannel(const QStringList &names);
+    void parseE2eKeyRequest(const QJsonArray &contents);
 Q_SIGNALS:
     void showUiInteraction(const QJsonArray &uiInteraction);
     void roomRemoved(const QByteArray &roomId);
diff --git a/src/core/rocketchatbackend.cpp b/src/core/rocketchatbackend.cpp
index 1684d72315..644c394e79 100644
--- a/src/core/rocketchatbackend.cpp
+++ b/src/core/rocketchatbackend.cpp
@@ -522,6 +522,17 @@ void RocketChatBackend::slotChanged(const QJsonObject &object)
             // Clear auth token otherwise we can't reconnect.
             mRocketChatAccount->settings()->setAuthToken({});
             qCDebug(RUQOLA_BACKEND_LOG) << "stream-notify-user : message event " << eventname << " contents " << contents;
+        } else if (eventname.endsWith("/e2ekeyRequest"_L1)) {
+            qDebug() << " 111111111111111111111111111stream-notify-room-users  e2e.keyRequest: " << object;
+            if (mRocketChatAccount->ruqolaLogger()) {
+                QJsonDocument d;
+                d.setObject(object);
+                mRocketChatAccount->ruqolaLogger()->dataReceived("stream-notify-user: e2ekeyRequest: "_ba + d.toJson());
+            } else {
+                qCDebug(RUQOLA_BACKEND_LOG) << "stream-notify-user: e2ekeyRequest :account name:" << mRocketChatAccount->accountName() << "object" << object;
+            }
+            mRocketChatAccount->parseE2eKeyRequest(contents);
+            qCDebug(RUQOLA_BACKEND_LOG) << "stream-notify-user : message event " << eventname << " contents " << contents;
         } else {
             if (mRocketChatAccount->ruqolaLogger()) {
                 QJsonDocument d;
@@ -739,6 +750,7 @@ void RocketChatBackend::subscribeRegistration()
         u"force_logout"_s,
         u"uiInteraction"_s,
         u"webdav"_s,
+        u"e2ekeyRequest"_s,
     };
     for (const QString &str : listStreamNotifierUser) {
         QJsonArray params;
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.