[All APIs] Fix: If the incoming email has no text only part, the html part is used [#470].
+
[All APIs] Fix: Improved the extraction of the plain text from html emails [#469].
+
[All APIs] If the option to use only existing tags is enabled, this now works also when adding tags manually using the ThunderAI menu [#475].
...
Version 3.6.0 - 30/07/2025
diff --git a/_locales/de/messages.json b/_locales/de/messages.json
index 4634bd97..ba2f8a88 100644
--- a/_locales/de/messages.json
+++ b/_locales/de/messages.json
@@ -838,10 +838,10 @@
"message": "ThunderAI Sparks nicht installiert!"
},
"prefs_OptionText_add_tags_auto_force_existing_Info": {
- "message": "Wenn ausgewählt, wird die KI nur vorhandene Tags zu neu empfangenen E-Mails hinzufügen und keine neuen Tags erstellen."
+ "message": "Wenn aktiviert, fügt die KI nur vorhandene Tags hinzu und erstellt keine neuen Tags."
},
"prefs_OptionText_add_tags_auto_force_existing": {
- "message": "Vorhandene Tags beim automatischen Taggen oder bei der Verwendung des Kontextmenüs erzwingen"
+ "message": "Vorhandene Tags erzwingen"
},
"spamfilter_no_reports": {
"message": "Es wurden noch keine Nachrichten auf Spam überprüft. Hier finden Sie eine Liste der letzten 100 Spam-Berichte nur für die aktuelle Sitzung."
@@ -1251,5 +1251,11 @@
},
"prefs_OptionText_chatgpt_web_br_replace_info": {
"message": "Bitte beachten Sie, dass alle -Tags in der Antwort der KI durch Zeilenumbrüche ersetzt werden."
+ },
+ "OpenAIComp_ClearModelsList_Confirm": {
+ "message": "Möchten Sie die Modellliste wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden."
+ },
+ "prefs_OpenAIComp_ClearModelsList": {
+ "message": "Modellliste löschen"
}
}
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index e7e5574a..b02f8c67 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -1120,11 +1120,11 @@
"description": ""
},
"prefs_OptionText_add_tags_auto_force_existing": {
- "message": "Force existing tags when autotagging or using the context menu",
+ "message": "Force existing tags",
"description": ""
},
"prefs_OptionText_add_tags_auto_force_existing_Info": {
- "message": "If checked, the AI will add only existing tags to newly received emails, and won't create new tags.",
+ "message": "If checked, the AI will add only existing tags and won't create new tags.",
"description": ""
},
"prefs_OptionText_add_tags_auto_only_inbox": {
@@ -1620,5 +1620,13 @@
"prefs_OptionText_chatgpt_web_br_replace_info": {
"message": "Please note that any tags in the AI's response will be replaced with line breaks.",
"description": ""
+ },
+ "prefs_OpenAIComp_ClearModelsList": {
+ "message": "Clear Models List",
+ "description": ""
+ },
+ "OpenAIComp_ClearModelsList_Confirm": {
+ "message": "Are you sure you want to clear the Models List? This action cannot be undone.",
+ "description": ""
}
}
\ No newline at end of file
diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json
index 81a9069e..4f31c877 100644
--- a/_locales/fr/messages.json
+++ b/_locales/fr/messages.json
@@ -838,10 +838,10 @@
"message": "Ici, vous pouvez également insérer l'adresse d'un serveur distant."
},
"prefs_OptionText_add_tags_auto_force_existing": {
- "message": "Forcer les balises existantes lors de l’auto-étiquetage ou de l’utilisation du menu contextuel"
+ "message": "Forcer les balises existantes"
},
"prefs_OptionText_add_tags_auto_force_existing_Info": {
- "message": "Si coché, l'IA ajoutera uniquement les tags existants aux e-mails nouvellement reçus et ne créera pas de nouveaux tags."
+ "message": "Si coché, l'IA ajoutera uniquement les tags existants et ne créera pas de nouveaux tags."
},
"prefs_OptionText_spamfilter_Info": {
"message": "Si coché, ThunderAI déplacera automatiquement les e-mails indésirables dans le dossier spam."
@@ -1251,5 +1251,11 @@
},
"prefs_OptionText_chatgpt_web_br_replace_info": {
"message": "Veuillez noter que toutes les balises dans la réponse de l'IA seront remplacées par des sauts de ligne."
+ },
+ "prefs_OpenAIComp_ClearModelsList": {
+ "message": "Effacer la liste des modèles"
+ },
+ "OpenAIComp_ClearModelsList_Confirm": {
+ "message": "Êtes-vous sûr de vouloir effacer la liste des modèles ? Cette action est irréversible."
}
}
diff --git a/_locales/it/messages.json b/_locales/it/messages.json
index 63bee007..58093c59 100644
--- a/_locales/it/messages.json
+++ b/_locales/it/messages.json
@@ -778,7 +778,7 @@
"message": "Aggiungi tag automaticamente"
},
"prefs_OptionText_add_tags_auto_force_existing": {
- "message": "Forza i tag esistenti durante l'autotagging o quando usi il menu di contesto"
+ "message": "Forza i tag esistenti"
},
"prefs_OptionText_add_tags_auto_only_inbox": {
"message": "Aggiungi tag solo alle email nella posta in arrivo"
@@ -847,7 +847,7 @@
"message": "Analizza la seguente email e determina se si tratta di spam o meno. Considera fattori come parole chiave sospette, linguaggio promozionale eccessivo, linee oggetto fuorvianti, richieste di informazioni personali e indirizzi del mittente insoliti.\nFornisci un valore da 0 (non spam) a 100 (spam) e una spiegazione di non più di 10 parole.\nIn caso di dati del messaggio mancanti, imposta il valore a 0 (non spam) e fornisci la motivazione.\nGenera una risposta esclusivamente in formato JSON. Non includere alcun testo o spiegazione aggiuntiva; fornisci solo il JSON. Ecco il formato da utilizzare:\n{\n\"spamValue\": ,\n\"explanation\": \"Breve spiegazione del tuo ragionamento\"\n}\nQui ci sono le informazioni sull'email:\nMittente: \"{%author%}\"\nOggetto: \"{%mail_subject%}\"\nCorpo HTML: \"{%mail_html_body%}\""
},
"prefs_OptionText_add_tags_auto_force_existing_Info": {
- "message": "Se selezionato, l'IA aggiungerà solo i tag esistenti alle email appena ricevute e non creerà nuovi tag."
+ "message": "Se selezionato, l'IA aggiungerà solo i tag esistenti e non creerà nuovi tag."
},
"spamfilter_threshold_too_low": {
"message": "La soglia di spam è troppo bassa! Probabilmente considererai troppe email come spam!"
@@ -1254,5 +1254,11 @@
},
"prefs_OptionText_chatgpt_web_br_replace_info": {
"message": "Ricorda che eventuali tag nella risposta dell'IA verranno sostituiti con interruzioni di riga."
+ },
+ "prefs_OpenAIComp_ClearModelsList": {
+ "message": "Svuota l'elenco dei modelli"
+ },
+ "OpenAIComp_ClearModelsList_Confirm": {
+ "message": "Sei sicuro di voler cancellare l’elenco dei modelli? Questa azione non può essere annullata."
}
}
diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json
index a69cb301..473a6c7b 100644
--- a/_locales/ru/messages.json
+++ b/_locales/ru/messages.json
@@ -834,10 +834,10 @@
"message": "Выберите, для какой учетной записи активировать эту функцию, в нижней части этой страницы."
},
"prefs_OptionText_add_tags_auto_force_existing": {
- "message": "Принудительное использование существующих тегов при авто тегировании или использовании контекстного меню"
+ "message": "Принудительное использование существующих тегов"
},
"prefs_OptionText_add_tags_auto_force_existing_Info": {
- "message": "Если флажок установлен, ИИ будет добавлять только существующие теги к вновь полученным сообщениям эл. почты и не будет создавать новые теги."
+ "message": "Если флажок установлен, ИИ будет добавлять только существующие теги и не будет создавать новые теги."
},
"prefs_OptionText_add_tags_auto_only_inbox": {
"message": "Добавляйте теги только к входящим сообщениям эл. почты"
@@ -1147,7 +1147,7 @@
"message": "Если флажок установлен, ваши чаты будут сохраняться OpenAI."
},
"prefs_ollama_think": {
- "message": "Позволяет мыслить"
+ "message": "Включить режим размышления"
},
"prefs_ollama_think_Info": {
"message": "Если флажок установлен, Модель будет думать перед ответом. Эта опция работает только с моделями, поддерживающими функцию \"думать\"."
@@ -1214,5 +1214,14 @@
},
"prompt_reply_custom_command_full_text": {
"message": "Ответьте на следующее письмо \"{%mail_text_body%}\". {%additional_text%}. Отвечайте только на нужный текст, без лишних комментариев или другого текста."
+ },
+ "prefs_OptionText_chatgpt_web_br_replace_info": {
+ "message": "Обратите внимание, что любые теги в ответе ИИ будут заменены переносами строк."
+ },
+ "prefs_OpenAIComp_ClearModelsList": {
+ "message": "Очистить список моделей"
+ },
+ "OpenAIComp_ClearModelsList_Confirm": {
+ "message": "Вы уверены, что хотите очистить список моделей? Это действие не может быть отменено."
}
}
diff --git a/js/mzta-menus.js b/js/mzta-menus.js
index a21cb5ad..c62fe7b0 100644
--- a/js/mzta-menus.js
+++ b/js/mzta-menus.js
@@ -19,7 +19,7 @@
// Some original methods are derived from https://github.com/ali-raheem/Aify/blob/cfadf52f576b7be3720b5b73af7c8d3129c054da/plugin/html/actions.js
import { getPrompts } from './mzta-prompts.js';
-import { getLanguageDisplayName, getMenuContextCompose, getMenuContextDisplay, i18nConditionalGet, getMailSubject, getTagsList, extractJsonObject, convertNewlinesToBr, cleanupNewlines } from './mzta-utils.js'
+import { getLanguageDisplayName, getMenuContextCompose, getMenuContextDisplay, i18nConditionalGet, getMailSubject, getTagsList, extractJsonObject, convertNewlinesToBr, cleanupNewlines, checkIfTagLabelExists } from './mzta-utils.js'
import { taPromptUtils } from './mzta-utils-prompt.js';
import { taLogger } from './mzta-logger.js';
import { placeholdersUtils } from './mzta-placeholders.js';
@@ -169,7 +169,8 @@ export class mzta_Menus {
switch(curr_prompt.id){
case 'prompt_add_tags': { // Add tags to the email
let tags_current_email = [];
- let prefs_at = await browser.storage.sync.get({add_tags_maxnum: 3, connection_type: '', add_tags_force_lang: true, default_chatgpt_lang: '', do_debug: false});
+ let tags_current_email_final = [];
+ let prefs_at = await browser.storage.sync.get({add_tags_maxnum: 3, connection_type: '', add_tags_force_lang: true, add_tags_auto_force_existing: false, default_chatgpt_lang: '', do_debug: false});
if((prefs_at.connection_type === '')||(prefs_at.connection_type === null)||(prefs_at.connection_type === undefined)||(prefs_at.connection_type === 'chatgpt_web')){
console.error("[ThunderAI | AddTags] Invalid connection type: " + prefs_at.connection_type);
taWorkingStatus.stopWorking();
@@ -177,6 +178,8 @@ export class mzta_Menus {
}
fullPrompt = taPromptUtils.finalizePrompt_add_tags(fullPrompt, prefs_at.add_tags_maxnum, prefs_at.add_tags_force_lang, prefs_at.default_chatgpt_lang);
this.logger.log("fullPrompt: " + fullPrompt);
+ let create_new_tags = !prefs_at.add_tags_auto_force_existing;
+ let all_tags_list = tags_full_list[1];
// TODO: use the current API, abort if using chatgpt web
// COMMENTED TO DO TESTS
// tags_current_email = "recipients, TEST, home, work, CAR, light";
@@ -184,6 +187,17 @@ export class mzta_Menus {
await cmd_addTags.initWorker();
try{
tags_current_email = taPromptUtils.getTagsFromResponse(await cmd_addTags.sendPrompt());
+ if(!create_new_tags){
+ this.logger.log("Not creating new tags, only showing existing ones...");
+ }
+ for (const tag of tags_current_email) {
+ // console.log(">>>>>>>>>>>>>>> tag: " + JSON.stringify(tag));
+ if (!create_new_tags && !checkIfTagLabelExists(tag, all_tags_list)) {
+ this.logger.log("Removing tag from the list: " + tag);
+ }else{
+ tags_current_email_final.push(tag);
+ }
+ }
// console.log(">>>>>>>>>>> tags_current_email: " + tags_current_email);
}catch(err){
console.error("[ThunderAI] Error getting tags: ", err);
@@ -191,9 +205,9 @@ export class mzta_Menus {
taWorkingStatus.stopWorking();
return {ok:'0'};
}
- this.logger.log("tags_current_email: " + JSON.stringify(tags_current_email));
+ this.logger.log("tags_current_email_final: " + JSON.stringify(tags_current_email_final));
this.logger.log("tags_full_list: " + JSON.stringify(tags_full_list));
- browser.tabs.sendMessage(tabs[0].id, {command: "getTags", tags: tags_current_email, messageId: curr_message.id});
+ browser.tabs.sendMessage(tabs[0].id, {command: "getTags", tags: tags_current_email_final, messageId: curr_message.id});
taWorkingStatus.stopWorking();
return {ok:'1'};
break; // Add tags to the email - END
diff --git a/js/mzta-utils.js b/js/mzta-utils.js
index b58070f0..772aa8a2 100644
--- a/js/mzta-utils.js
+++ b/js/mzta-utils.js
@@ -17,7 +17,7 @@
*/
const sparks_min = '1.2.0'; // Minimum version of ThunderAI-Sparks required for the add-on to work
-export const ChatGPTWeb_models = ['gpt-5','gpt-5-thinking','gpt-4o']; // List of models available in ChatGPT Web
+export const ChatGPTWeb_models = ['gpt-5','gpt-5-instant','gpt-5-t-mini','gpt-5-thinking']; // List of models available in ChatGPT Web
export const getMenuContextCompose = () => 'compose_action_menu';
export const getMenuContextDisplay = () => 'message_display_action_menu';
@@ -246,12 +246,12 @@ export function getGPTWebModelString(model) {
switch (model) {
case 'gpt-5':
return '5';
+ case 'gpt-5-instant':
+ return '5 Fast';
+ case 'gpt-5-t-mini':
+ return '5 Thinking mini';
case 'gpt-5-thinking':
- return '5 Thinking';
- case 'gpt-4o':
- return '4o';
- case 'gpt-4o-mini':
- return '4o mini';
+ return '5 Thinking';
default:
return model;
}
diff --git a/manifest.json b/manifest.json
index 83252691..24110b01 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "ThunderAI",
"description": "__MSG_extensionDescription__",
- "version": "3.6.1_issue_469",
+ "version": "3.6.1",
"author": "Mic (m@micz.it)",
"homepage_url": "https://micz.it/thunderbird-addon-thunderai/",
"browser_specific_settings": {
diff --git a/mzta-background.js b/mzta-background.js
index 4f507230..35cff2b1 100644
--- a/mzta-background.js
+++ b/mzta-background.js
@@ -976,11 +976,6 @@ async function processEmails(messages, addTagsAuto, spamFilter) {
if (addTagsAuto || spamFilter) {
curr_fullMessage = await browser.messages.getFull(message.id);
msg_text = getMailBody(curr_fullMessage);
- // body_text = msg_text.text.replace(/\s+/g, ' ').trim();
- // if( body_text.length == 0 ){
- // taLog.log("No text found in the message body, trying to convert HTML to plain text...");
- // body_text = htmlBodyToPlainText(msg_text.html);
- // }
taLog.log("Startin from the HTML body if present and converting to plain text...");
body_text = htmlBodyToPlainText(msg_text.html);
if( body_text.length == 0 ){
diff --git a/options/mzta-options.html b/options/mzta-options.html
index 20286c50..f8c12e4b 100644
--- a/options/mzta-options.html
+++ b/options/mzta-options.html
@@ -410,7 +410,8 @@