Stephane

Informazioni utente

Informazioni sullo sviluppatore
Nome Stephane
Utente da Giugno 5, 2018
Numero di componenti aggiuntivi sviluppati 0 componenti aggiuntivi
Media delle valutazioni sui componenti aggiuntivi di questo sviluppatore. Nessun voto

Le mie recensioni

Auto Filter Timer

Assegnate 3 su 5 stelle

Very useful addon. It works well except for a bug at startup.
When restoring the filter schedules, it sometimes assign them to the wrong folder.

Here is a patch for that issue:

==========

$ diff -rU 2 auto_filter_timer-1.03 auto_filter_timer-1.04
diff -rU 2 auto_filter_timer-1.03/content/schedulefilters.js auto_filter_timer-1.04/content/schedulefilters.js
--- auto_filter_timer-1.03/content/schedulefilters.js 2018-04-13 17:59:16.000000000 +0200
+++ auto_filter_timer-1.04/content/schedulefilters.js 2018-06-05 23:36:28.463433487 +0200
@@ -233,13 +233,17 @@
}

-function addFiltersSchedule() {
+function addFiltersSchedule( folder ) {
var stringsBundle = document.getElementById("schedulefilters-string-bundle");
var num = promptNumber(stringsBundle.getString('addSchedule'), stringsBundle.getString('period'), 1, 1440, 30);
if (num != null) {
- _addFiltersSchedule(num, true);
+ _addFiltersSchedule(folder, num, true);
}
}
-function _addFiltersSchedule(num, needSave) {
- var folder = GetFirstSelectedMsgFolder();
+function _addFiltersSchedule(folder, num, needSave) {
+ // If the folder is not specified, this function was called from the Thunderbird interface by the user
+ // If the folder is defined, this function is called from the loadFiltersSchedule function at startup
+ if ( folder == null ) {
+ folder = GetFirstSelectedMsgFolder();
+ }
var idInterval = scheduleFilters(folder, num*60000);
filterSchedule.add(folder, idInterval, num);
@@ -252,5 +256,5 @@
var item = filterSchedule.get(folder);
if (item == null) {
- addFiltersSchedule();
+ addFiltersSchedule( folder );
return;
}
@@ -289,9 +293,10 @@
for (var i=0;i<schedule.length;i++) {
var folderUri = schedule[i].uri;
- if ((msgWindow.openFolder == null) || (msgWindow.openFolder.URI != folderUri)) {
- var folder = MailUtils.getFolderForURI(folderUri);
- gFolderTreeView.selectFolder(folder);
- }
- _addFiltersSchedule(schedule[i].time, false);
+ // NOTE - Selecting a folder to apply a schedule doesn't work at startup, as Thunderbird or other add-ons can modify the selected folder at any time
+ //if ((msgWindow.openFolder == null) || (msgWindow.openFolder.URI != folderUri)) {
+ var folder = MailUtils.getFolderForURI(folderUri);
+ //gFolderTreeView.selectFolder(folder);
+ //}
+ _addFiltersSchedule(folder, schedule[i].time, false);
}
} catch (err) {

==========

Questa recensione riguarda una versione precedente (1.03) del componente aggiuntivo.