diff --git a/_locales/en/messages.json b/_locales/en/messages.json index d559de72cd..6883e2bbbc 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -5307,6 +5307,10 @@ "messageformat": "Delete selected messages", "description": "Shown in the shortcuts guide" }, + "icu:Keyboard--forward-messages": { + "messageformat": "Forward selected messages", + "description": "Shown in the shortcuts guide" + }, "Keyboard--add-newline": { "message": "Add newline to message", "description": "(deleted 03/29/2023) Shown in the shortcuts guide" diff --git a/ts/background.ts b/ts/background.ts index 373da88433..b33638d0d2 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -1753,6 +1753,31 @@ export async function startApp(): Promise { } } + if ( + conversation && + commandOrCtrl && + shiftKey && + (key === 's' || key === 'S') + ) { + const { hasConfirmationModal } = state.globalModals; + const { targetedMessage, selectedMessageIds } = state.conversations; + + const messageIds = + selectedMessageIds ?? + (targetedMessage != null ? [targetedMessage] : null); + + if (!hasConfirmationModal && messageIds != null) { + event.preventDefault(); + event.stopPropagation(); + + window.reduxActions.globalModals.toggleForwardMessagesModal( + messageIds + ); + + return; + } + } + // COMPOSER // Create a newline in your message - handled by component diff --git a/ts/components/ShortcutGuide.tsx b/ts/components/ShortcutGuide.tsx index 6a7511fdba..9e621200e8 100644 --- a/ts/components/ShortcutGuide.tsx +++ b/ts/components/ShortcutGuide.tsx @@ -30,6 +30,7 @@ type KeyType = | 'D' | 'E' | 'F' + | 'G' | 'J' | 'L' | 'M' @@ -130,7 +131,7 @@ function getNavigationShortcuts(i18n: LocalizerType): Array { { id: 'Keyboard--open-sticker-chooser', description: i18n('icu:Keyboard--open-sticker-chooser'), - keys: [['commandOrCtrl', 'shift', 'S']], + keys: [['commandOrCtrl', 'shift', 'G']], }, { id: 'Keyboard--begin-recording-voice-note', @@ -197,6 +198,11 @@ function getMessageShortcuts(i18n: LocalizerType): Array { description: i18n('icu:Keyboard--delete-messages'), keys: [['commandOrCtrl', 'shift', 'D']], }, + { + id: 'Keyboard--forward-messages', + description: i18n('icu:Keyboard--forward-messages'), + keys: [['commandOrCtrl', 'shift', 'S']], + }, ]; } diff --git a/ts/components/stickers/StickerButton.tsx b/ts/components/stickers/StickerButton.tsx index ad10490555..88ec21e81a 100644 --- a/ts/components/stickers/StickerButton.tsx +++ b/ts/components/stickers/StickerButton.tsx @@ -201,7 +201,7 @@ export const StickerButton = React.memo(function StickerButtonInner({ return; } - if (commandOrCtrl && shiftKey && (key === 's' || key === 'S')) { + if (commandOrCtrl && shiftKey && (key === 'g' || key === 'G')) { event.stopPropagation(); event.preventDefault();