added an option to hide the spam filter info in the message. see #506
This commit is contained in:
parent
0550077567
commit
b4ae956b82
4 changed files with 31 additions and 6 deletions
|
|
@ -1347,6 +1347,14 @@
|
||||||
"message": "If the value returned by the AI is above this threshold, the email will be moved to the spam folder.",
|
"message": "If the value returned by the AI is above this threshold, the email will be moved to the spam folder.",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
"prefs_OptionText_spamfilter_show_msg_panel": {
|
||||||
|
"message": "Show spam report panel",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"prefs_OptionText_spamfilter_show_msg_panel_Info": {
|
||||||
|
"message": "If checked, a panel with the spam report will be shown on top of the message.",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
"spamfilter_threshold_too_low": {
|
"spamfilter_threshold_too_low": {
|
||||||
"message": "The spam threshold is too low! You will likely mark too much mails as spam!",
|
"message": "The spam threshold is too low! You will likely mark too much mails as spam!",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
|
|
||||||
|
|
@ -359,6 +359,10 @@ messenger.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||||
browser.tabs.sendMessage(message.tabId, { command: "api_send_custom_text", custom_text: message.custom_text });
|
browser.tabs.sendMessage(message.tabId, { command: "api_send_custom_text", custom_text: message.custom_text });
|
||||||
break;
|
break;
|
||||||
case 'checkSpamReport':
|
case 'checkSpamReport':
|
||||||
|
if(!prefs_init.spamfilter_show_msg_panel){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
async function _checkSpamReport(tabId) {
|
async function _checkSpamReport(tabId) {
|
||||||
try {
|
try {
|
||||||
if (sender.tab.type !== 'messageDisplay' && sender.tab.type !== 'mail') return;
|
if (sender.tab.type !== 'messageDisplay' && sender.tab.type !== 'mail') return;
|
||||||
|
|
@ -834,6 +838,7 @@ async function reload_pref_init(){
|
||||||
spamfilter: prefs_default.spamfilter,
|
spamfilter: prefs_default.spamfilter,
|
||||||
summarize: prefs_default.summarize,
|
summarize: prefs_default.summarize,
|
||||||
spamfilter_threshold: prefs_default.spamfilter_threshold,
|
spamfilter_threshold: prefs_default.spamfilter_threshold,
|
||||||
|
spamfilter_show_msg_panel: prefs_default.spamfilter_show_msg_panel,
|
||||||
dynamic_menu_force_enter: prefs_default.dynamic_menu_force_enter,
|
dynamic_menu_force_enter: prefs_default.dynamic_menu_force_enter,
|
||||||
...getDynamicSettingsDefaults(['use_specific_integration', 'connection_type'])
|
...getDynamicSettingsDefaults(['use_specific_integration', 'connection_type'])
|
||||||
});
|
});
|
||||||
|
|
@ -1288,6 +1293,7 @@ async function processEmails(messages, addTagsAuto, spamFilter) {
|
||||||
taSpamReport.saveReportData(report_data, message.headerMessageId);
|
taSpamReport.saveReportData(report_data, message.headerMessageId);
|
||||||
|
|
||||||
// Check if the message is currently displayed and update the banner
|
// Check if the message is currently displayed and update the banner
|
||||||
|
if (prefs_init.spamfilter_show_msg_panel) {
|
||||||
let tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
let tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||||
if (tabs.length > 0) {
|
if (tabs.length > 0) {
|
||||||
let activeTab = tabs[0];
|
let activeTab = tabs[0];
|
||||||
|
|
@ -1298,6 +1304,7 @@ async function processEmails(messages, addTagsAuto, spamFilter) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
taWorkingStatus.stopWorking();
|
taWorkingStatus.stopWorking();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ export const prefs_default = {
|
||||||
spamfilter: false,
|
spamfilter: false,
|
||||||
spamfilter_threshold: 70,
|
spamfilter_threshold: 70,
|
||||||
spamfilter_enabled_accounts: [],
|
spamfilter_enabled_accounts: [],
|
||||||
|
spamfilter_show_msg_panel: true,
|
||||||
summarize: false,
|
summarize: false,
|
||||||
...generated_prefs
|
...generated_prefs
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,15 @@
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr class="spamfilter_tr">
|
||||||
|
<td><span class="opt_title">__MSG_prefs_OptionText_spamfilter_show_msg_panel__</span></td>
|
||||||
|
<td>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="spamfilter_show_msg_panel" name="spamfilter_show_msg_panel" class="option-input" />
|
||||||
|
__MSG_prefs_OptionText_spamfilter_show_msg_panel_Info__
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<div id="spamfilter_container">
|
<div id="spamfilter_container">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue