From d1dce37ea7ed207da9f3def7a190440172f46695 Mon Sep 17 00:00:00 2001 From: Christopher Hock Date: Sun, 7 Nov 2021 16:12:29 +0000 Subject: [PATCH] Allow user to copy the room address to the clipboard Contributes to #469 --- imports/NeoChat/Menu/RoomListContextMenu.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/imports/NeoChat/Menu/RoomListContextMenu.qml b/imports/NeoChat/Menu/RoomListContextMenu.qml index be0990c85..3efe8c281 100644 --- a/imports/NeoChat/Menu/RoomListContextMenu.qml +++ b/imports/NeoChat/Menu/RoomListContextMenu.qml @@ -10,6 +10,7 @@ import org.kde.kirigami 2.19 as Kirigami import org.kde.neochat 1.0 import NeoChat.Page 1.0 + /** * Context menu when clicking on a room in the room list */ @@ -46,6 +47,18 @@ Menu { onTriggered: room.markAllMessagesAsRead() } + MenuItem { + text: i18nc("@action:inmenu", "Copy address to clipboard") + + onTriggered: { + if (room.canonicalAlias.length === 0) { + Clipboard.saveText(room.id) + } else { + Clipboard.saveText(room.canonicalAlias) + } + } + } + MenuSeparator {} MenuItem {