[network/ruqola] src/widgets/room: Activate menu action for encrypting message

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 90de19c5062fb8b77c46937fc9dee5e51884018d by Laurent Montel.
Committed on 06/08/2026 at 04:54.
Pushed by mlaurent into branch 'master'.

Activate menu action for encrypting message

M  +2    -2    src/widgets/room/channelactionpopupmenu.cpp
M  +2    -1    src/widgets/room/roomheaderwidget.h
M  +4    -1    src/widgets/room/roomwidget.cpp

https://invent.kde.org/network/ruqola/-/commit/90de19c5062fb8b77c46937fc9dee5e51884018d

diff --git a/src/widgets/room/channelactionpopupmenu.cpp b/src/widgets/room/channelactionpopupmenu.cpp
index 5fa2db066b..7b7d7d3d02 100644
--- a/src/widgets/room/channelactionpopupmenu.cpp
+++ b/src/widgets/room/channelactionpopupmenu.cpp
@@ -134,8 +134,8 @@ void ChannelActionPopupMenu::createMenu()
     mEncryptMessages = new QAction(i18nc("@action", "Encrypt Messages"), this);
     mEncryptMessages->setCheckable(true);
     mMenu->addAction(mEncryptMessages);
-    connect(mEncryptMessages, &QAction::triggered, this, [this]() {
-        Q_EMIT actionRequested(RoomHeaderWidget::EncryptMessages);
+    connect(mEncryptMessages, &QAction::triggered, this, [this](bool state) {
+        Q_EMIT actionRequested(state ? RoomHeaderWidget::EncryptMessages : RoomHeaderWidget::UnEncryptMessages);
     });
     mShowBannedUsers = new QAction(i18nc("@action", "Show Banned Users…"), this);
     mMenu->addAction(mShowBannedUsers);
diff --git a/src/widgets/room/roomheaderwidget.h b/src/widgets/room/roomheaderwidget.h
index d813faf112..d944e426ed 100644
--- a/src/widgets/room/roomheaderwidget.h
+++ b/src/widgets/room/roomheaderwidget.h
@@ -40,7 +40,8 @@ public:
         ExportMessages = 13,
         OtrMessages = 14,
         EncryptMessages = 15,
-        ShowBannedUsers = 16,
+        UnEncryptMessages = 16,
+        ShowBannedUsers = 17,
     };
     Q_ENUM(ChannelActionType)
 
diff --git a/src/widgets/room/roomwidget.cpp b/src/widgets/room/roomwidget.cpp
index 9786133fbe..2d17a84ccc 100644
--- a/src/widgets/room/roomwidget.cpp
+++ b/src/widgets/room/roomwidget.cpp
@@ -389,7 +389,10 @@ void RoomWidget::slotActionRequested(RoomHeaderWidget::ChannelActionType type)
         // TODO
         break;
     case RoomHeaderWidget::EncryptMessages:
-        // TODO
+        slotEncryptedChanged(true);
+        break;
+    case RoomHeaderWidget::UnEncryptMessages:
+        slotEncryptedChanged(false);
         break;
     case RoomHeaderWidget::ShowBannedUsers:
         slotShowBannedUsers();
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.