diff --git a/background.js b/background.js index 0274d07..2e868c8 100644 --- a/background.js +++ b/background.js @@ -16,6 +16,8 @@ async function executeErledigtAction(tab, actionConfig) { const storage = await browser.storage.local.get(['gitea_config', 'schlagwoerter_cache']); const config = storage.gitea_config || {}; const schlagwoerter = storage.schlagwoerter_cache; + // "Als gelesen markieren" — pro Aktion konfigurierbar, standardmäßig an. + const markRead = (actionConfig || {}).markRead !== false; // Apply user's tag let tagKey = null; @@ -33,6 +35,11 @@ async function executeErledigtAction(tab, actionConfig) { } } + // Mark as read (before the move, while the id is still valid in this folder) + if (markRead && !message.read) { + await messenger.messages.update(message.id, { read: true }); + } + // Move to target folder if (actionConfig.targetFolder) { const folderInfo = JSON.parse(actionConfig.targetFolder); @@ -42,6 +49,7 @@ async function executeErledigtAction(tab, actionConfig) { // Feedback const parts = []; if (tagKey) parts.push('markiert'); + if (markRead && !message.read) parts.push('gelesen'); if (actionConfig.targetFolder) parts.push('verschoben'); const title = actionConfig.name || 'Erledigt'; browser.notifications.create({ @@ -68,12 +76,19 @@ messenger.messageDisplayAction.onClicked.addListener(async (tab) => { async function updateErledigtPopup() { const result = await browser.storage.local.get('erledigt_config'); const actions = (result.erledigt_config || {}).actions || []; + const setLabel = (label) => { + // setLabel ist Thunderbird-spezifisch — defensiv prüfen, damit der Start nie bricht. + if (messenger.messageDisplayAction.setLabel) return messenger.messageDisplayAction.setLabel({ label }); + }; if (actions.length > 1) { await messenger.messageDisplayAction.setPopup({ popup: 'message_popup.html' }); await messenger.messageDisplayAction.setTitle({ title: 'Aktion wählen' }); + await setLabel('QuickMove'); } else { + const name = actions[0]?.name || 'QuickMove'; await messenger.messageDisplayAction.setPopup({ popup: '' }); - await messenger.messageDisplayAction.setTitle({ title: actions[0]?.name || 'Erledigt' }); + await messenger.messageDisplayAction.setTitle({ title: name }); + await setLabel(name); // Button heißt wie die (einzige) Aktion } } diff --git a/manifest.json b/manifest.json index 16147af..7ab97d6 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "HPS Vorlagen & Signaturen", - "version": "2.3.3", + "version": "2.3.4", "description": "Vorlagen- und Signaturverwaltung für Hotel Park Soltau mit Git-Sync", "browser_specific_settings": { "gecko": { diff --git a/templates-reply-hotel.xpi b/templates-reply-hotel.xpi index 20b23eb..2b7b008 100644 Binary files a/templates-reply-hotel.xpi and b/templates-reply-hotel.xpi differ diff --git a/templates_options/templates_options.js b/templates_options/templates_options.js index 19349d2..b5d73cd 100644 --- a/templates_options/templates_options.js +++ b/templates_options/templates_options.js @@ -1879,6 +1879,12 @@ function renderErledigtAction(action, index) { ${erledigtFolderOptions} +
+ ${index === 0 ? '' : ''} + +
`; if (action.targetFolder) { @@ -1900,10 +1906,11 @@ function getErledigtActionsFromForm() { const actions = []; const names = document.querySelectorAll('.erledigt-name'); const folders = document.querySelectorAll('.erledigt-folder'); + const reads = document.querySelectorAll('.erledigt-markread'); for (let i = 0; i < names.length; i++) { const name = names[i].value.trim(); if (!name) continue; - actions.push({ name, targetFolder: folders[i].value || '' }); + actions.push({ name, targetFolder: folders[i].value || '', markRead: reads[i] ? reads[i].checked : true }); } return actions; } diff --git a/updates.json b/updates.json index 7d4394a..7c55d5e 100644 --- a/updates.json +++ b/updates.json @@ -2,6 +2,16 @@ "addons": { "it@hotel-park-soltau.de": { "updates": [ + { + "version": "2.3.4", + "update_link": "https://git.hotel-park-soltau.de/hps/hps-thunderbird-templates/releases/download/v2.3.4/templates-reply-hotel.xpi", + "update_hash": "sha256:1825f81c309c7d2be4bba048b1e41d0758bb145823b765c0dbb8add75cd4ad2e", + "applications": { + "gecko": { + "strict_min_version": "109.0" + } + } + }, { "version": "2.3.3", "update_link": "https://git.hotel-park-soltau.de/hps/hps-thunderbird-templates/releases/download/v2.3.3/templates-reply-hotel.xpi",