[network/ruqola] src: Add encrypted document icon (Thanks Nuno).

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

Add encrypted document icon (Thanks Nuno).

Show icon when text is encrypted

M  +3    -1    src/core/messages/message.cpp
A  +80   -0    src/widgets/icons/document-encrypted-symbolic.svg
M  +1    -2    src/widgets/room/delegate/messagelistdelegate.cpp
M  +1    -0    src/widgets/room/delegate/messagelistdelegate.h
M  +1    -0    src/widgets/ruqolawidget.qrc

https://invent.kde.org/network/ruqola/-/commit/21c9086a44f7a812a8111067c9ec54101ab87529

diff --git a/src/core/messages/message.cpp b/src/core/messages/message.cpp
index d51324a054..265c384792 100644
--- a/src/core/messages/message.cpp
+++ b/src/core/messages/message.cpp
@@ -214,7 +214,9 @@ bool Message::isAutoTranslated() const
 
 bool Message::isEncryptedMessage() const
 {
-    // TODO
+    if (mMessageEncrypted && mMessageEncrypted->hasDescriptedContent()) {
+        return true;
+    }
     return false;
 }
 
diff --git a/src/widgets/icons/document-encrypted-symbolic.svg b/src/widgets/icons/document-encrypted-symbolic.svg
new file mode 100644
index 0000000000..6c094a3647
--- /dev/null
+++ b/src/widgets/icons/document-encrypted-symbolic.svg
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   height="16"
+   width="16"
+   version="1.1"
+   id="svg1"
+   xml:space="preserve"
+   sodipodi:docname="document-encrypted-symbolic.svg"
+   inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
+   id="namedview1"
+   pagecolor="#505050"
+   bordercolor="#eeeeee"
+   borderopacity="1"
+   inkscape:showpageshadow="0"
+   inkscape:pageopacity="0"
+   inkscape:pagecheckerboard="0"
+   inkscape:deskcolor="#505050"
+   showgrid="true"
+   inkscape:zoom="39.016026"
+   inkscape:cx="8.0223445"
+   inkscape:cy="5.1389139"
+   inkscape:current-layer="svg1"><inkscape:grid
+     id="grid1"
+     units="px"
+     originx="0"
+     originy="0"
+     spacingx="1"
+     spacingy="1"
+     empcolor="#0099e5"
+     empopacity="0.30196078"
+     color="#0099e5"
+     opacity="0.14902"
+     empspacing="2"
+     enabled="true"
+     visible="true" /></sodipodi:namedview>
+  <defs
+   id="defs1">
+    <style
+   type="text/css"
+   id="current-color-scheme">
+            .ColorScheme-Text {
+                color:#232629;
+            }
+        </style>
+  </defs>
+  <path
+   id="path2"
+   style="opacity:0.1;fill:currentColor"
+   class="ColorScheme-Text"
+   d="M 3,1 C 1.9644702,1 1.1121856,1.7864133 1.0097656,2.7949219 1.0029376,2.8621558 1,2.9309646 1,3 v 10 c 0,1.104565 0.8954349,2 2,2 H 9.011719 C 9.004426,14.927725 9,14.85533 9,14.78125 V 11.835938 C 9,11.118361 9.474813,10.613865 10.072266,10.304688 10.152976,9.098615 10.921991,8.061531 12,7.658203 V 3 C 12,1.8954349 11.104565,1 10,1 Z m 4,6 h 3 V 9 H 7 Z"
+   sodipodi:nodetypes="ssssscssccsssccccc" />
+  <path
+   id="path1"
+   style="opacity:0.6;fill:currentColor"
+   class="ColorScheme-Text"
+   d="M 3,0 C 1.3431509,0 0,1.3431509 0,3 v 10 c 0,1.656848 1.3431509,3 3,3 H 9.373047 C 9.176429,15.707863 9.048716,15.366638 9.011719,15 H 3 C 1.8954338,15 1,14.104566 1,13 V 3 C 1,1.8954338 1.8954338,1 3,1 h 7 c 1.104566,0 2,0.8954338 2,2 V 7.658203 C 12.310274,7.542117 12.645463,7.478516 12.998047,7.478516 H 13 V 3 C 13,1.3431509 11.656848,0 10,0 Z"
+   sodipodi:nodetypes="ssssccsssssscscsss" />
+  <g
+   id="g3"
+   transform="translate(-5,-5)">
+    <path
+   id="path1-5"
+   style="fill:currentColor"
+   class="ColorScheme-Text"
[suppressed due to size limit]
+
+
+    <g
+   id="g9"
+   transform="translate(0,0.979492)" />
+  </g>
+<path
+   id="rect1"
+   style="opacity:0.4;fill:#23262a;fill-opacity:0.6;fill-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke fill markers"
+   d="M 3,3 V 5 H 6 V 3 Z m 4,0 v 2 h 3 V 3 Z M 3,7 V 9 H 6 V 7 Z"
+   sodipodi:nodetypes="ccccccccccccccc" /></svg>
diff --git a/src/widgets/room/delegate/messagelistdelegate.cpp b/src/widgets/room/delegate/messagelistdelegate.cpp
index b9d9dee75f..54e0929a4c 100644
--- a/src/widgets/room/delegate/messagelistdelegate.cpp
+++ b/src/widgets/room/delegate/messagelistdelegate.cpp
@@ -69,7 +69,7 @@ MessageListDelegate::MessageListDelegate(RocketChatAccount *account, QListView *
     , mPinIcon(QIcon::fromTheme(u"pin"_s))
     , mTranslatedIcon(QIcon::fromTheme(u"translate"_s))
     , mReplyInThreadIcon(QIcon::fromTheme(u"view-conversation-balloon-symbolic"_s))
-    , mEncryptedIcon(QIcon::fromTheme(u"document-encrypt"_s))
+    , mEncryptedIcon(QIcon(u":/messages_icons/icons/document-encrypted-symbolic.svg"_s))
     , mTextToSpeechIcon(QIcon::fromTheme(u"player-volume"_s))
     , mSingleCheckIcon(QIcon(u":/messages_icons/icons/single-check.svg"_s))
     , mDoubleCheckIcon(QIcon(u":/messages_icons/icons/double-check.svg"_s))
@@ -640,7 +640,6 @@ void MessageListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
     }
 
     // Draw encrypted icon
-    // TODO implement encrypted message
     if (message->isEncryptedMessage()) {
         mEncryptedIcon.paint(painter, layout.encryptedIconRect);
     }
diff --git a/src/widgets/room/delegate/messagelistdelegate.h b/src/widgets/room/delegate/messagelistdelegate.h
index 75f0f13d69..2725b80fa7 100644
--- a/src/widgets/room/delegate/messagelistdelegate.h
+++ b/src/widgets/room/delegate/messagelistdelegate.h
@@ -154,6 +154,7 @@ private:
     const QIcon mTextToSpeechIcon;
     const QIcon mSingleCheckIcon;
     const QIcon mDoubleCheckIcon;
+    const QIcon mEncryptedMessageIcon;
     QColor mTranslatedMessageColor;
     QColor mEditColorMode;
     QColor mThreadedMessageBackgroundColor;
diff --git a/src/widgets/ruqolawidget.qrc b/src/widgets/ruqolawidget.qrc
index 7dc0a38a1c..7d7a23b4d8 100644
--- a/src/widgets/ruqolawidget.qrc
+++ b/src/widgets/ruqolawidget.qrc
@@ -10,5 +10,6 @@
         <file>icons/single-check.svg</file>
         <file>icons/double-check.svg</file>
         <file>icons/encrypt-background.png</file>
+        <file>icons/document-encrypted-symbolic.svg</file>
     </qresource>
 </RCC>
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.