Merge branch 'main' of github.com:micz/ThunderAI
This commit is contained in:
commit
e1d97cfc5c
6 changed files with 13 additions and 20 deletions
|
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Version 3.2.2 - ??/??/2025</h2>
|
||||||
|
<ul>
|
||||||
|
<li>...</li>
|
||||||
|
</ul>
|
||||||
<h2>Version 3.2.1 - 03/03/2025</h2>
|
<h2>Version 3.2.1 - 03/03/2025</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Fix calling a prompt without giving tags related permissions [<a href="https://github.com/micz/ThunderAI/issues/275">#275</a>].</li>
|
<li>Fix calling a prompt without giving tags related permissions [<a href="https://github.com/micz/ThunderAI/issues/275">#275</a>].</li>
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,8 @@ export async function getPlaceholders(onlyEnabled = false){
|
||||||
output.sort((a, b) => a.id.localeCompare(b.id));
|
output.sort((a, b) => a.id.localeCompare(b.id));
|
||||||
}
|
}
|
||||||
// console.log('>>>>>>>>>>>> getPlaceholders output: ' + JSON.stringify(output));
|
// console.log('>>>>>>>>>>>> getPlaceholders output: ' + JSON.stringify(output));
|
||||||
if (!await browser.permissions.contains({ permissions: ["messagesTagsList"] })) {
|
let prefs = await browser.storage.local.get({ add_tags: false });
|
||||||
|
if (prefs.add_tags) {
|
||||||
output = output.filter(obj => obj.id !== 'tags_full_list' && obj.id !== 'tags_current_email');
|
output = output.filter(obj => obj.id !== 'tags_full_list' && obj.id !== 'tags_current_email');
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "ThunderAI",
|
"name": "ThunderAI",
|
||||||
"description": "__MSG_extensionDescription__",
|
"description": "__MSG_extensionDescription__",
|
||||||
"version": "3.2.1",
|
"version": "3.2.2",
|
||||||
"author": "Mic (m@micz.it)",
|
"author": "Mic (m@micz.it)",
|
||||||
"homepage_url": "https://micz.it/thunderbird-addon-thunderai/",
|
"homepage_url": "https://micz.it/thunderbird-addon-thunderai/",
|
||||||
"browser_specific_settings": {
|
"browser_specific_settings": {
|
||||||
|
|
|
||||||
|
|
@ -796,20 +796,4 @@ const newEmailListener = (folder, messagesList) => {
|
||||||
return _newEmailListener();
|
return _newEmailListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable tag option if permissions are not granted
|
|
||||||
if (prefs_init.add_tags) {
|
|
||||||
if(!await browser.permissions.contains({permissions: ["messagesTagsList", "messagesTags", "messagesUpdate"]})){
|
|
||||||
browser.storage.sync.set({add_tags: false});
|
|
||||||
taLog.log("Permissions not granted, disabling add_tags");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable anti spam option if permissions are not granted
|
|
||||||
if (prefs_init.spamfilter) {
|
|
||||||
if(!await browser.permissions.contains({permissions: ["messagesMove"]})){
|
|
||||||
browser.storage.sync.set({spamfilter: false});
|
|
||||||
taLog.log("Permissions not granted, disabling spamfilter");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
browser.messages.onNewMailReceived.addListener(newEmailListener, !prefs_init.add_tags_auto_only_inbox);
|
browser.messages.onNewMailReceived.addListener(newEmailListener, !prefs_init.add_tags_auto_only_inbox);
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
addtags_el.addEventListener('click', (event) => {
|
addtags_el.addEventListener('click', (event) => {
|
||||||
async function _addtags_el_change() {
|
async function _addtags_el_change() {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
const granted = await messenger.permissions.request({ permissions: ["messagesTagsList", "messagesTags", "messagesUpdate"] });
|
let granted = await messenger.permissions.request({ permissions: ["messagesTagsList", "messagesTags", "messagesUpdate"] });
|
||||||
if (!granted) {
|
if (!granted) {
|
||||||
event.target.checked = false;
|
event.target.checked = false;
|
||||||
addtags_info_btn.disabled = 'disabled';
|
addtags_info_btn.disabled = 'disabled';
|
||||||
|
|
@ -319,7 +319,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
spamfilter_el.addEventListener('click', (event) => {
|
spamfilter_el.addEventListener('click', (event) => {
|
||||||
async function _spamfilter_el_change() {
|
async function _spamfilter_el_change() {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
const granted = await messenger.permissions.request({ permissions: ["messagesMove"] });
|
let granted = await messenger.permissions.request({ permissions: ["messagesMove"] });
|
||||||
if (!granted) {
|
if (!granted) {
|
||||||
event.target.checked = false;
|
event.target.checked = false;
|
||||||
spamfilter_info_btn.disabled = 'disabled';
|
spamfilter_info_btn.disabled = 'disabled';
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="miczBackPrefs"><a href="mzta-options.html">__MSG_backToOptionsText__</a></div>
|
<div id="miczBackPrefs"><a href="mzta-options.html">__MSG_backToOptionsText__</a></div>
|
||||||
<div id="miczRelNotes"><h1>ThunderAI Release Notes</h1>
|
<div id="miczRelNotes"><h1>ThunderAI Release Notes</h1>
|
||||||
|
<h2>Version 3.2.2 - ??/??/2025</h2>
|
||||||
|
<ul>
|
||||||
|
<li>...</li>
|
||||||
|
</ul>
|
||||||
<h2>Version 3.2.1 - 03/03/2025</h2>
|
<h2>Version 3.2.1 - 03/03/2025</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Fix calling a prompt without giving tags related permissions [<a href="https://github.com/micz/ThunderAI/issues/275">#275</a>].</li>
|
<li>Fix calling a prompt without giving tags related permissions [<a href="https://github.com/micz/ThunderAI/issues/275">#275</a>].</li>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue