Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#25 Junk notifications in TB3

ThunderSnarl
open
nobody
None
5
2010-03-24
2010-03-24
Anonymous
No

In current ThunderSnarl POP3 mail is processed right on arrival in Inbox. If the message is spam it is signaled to Snarl before the junk filter have a chance to classify it. The fix is approximately the following:

Index: startStopObserver.js

--- startStopObserver.js (revision 353)
+++ startStopObserver.js (working copy)
@@ -104,9 +104,9 @@
notificationService.addListener(newMailListener);
} catch(e) {
// probably it's a Thunderbird 3 which needs a second param
- notificationService.addListener(newMailListener, 1);
+ notificationService.addListener(newMailListener, 8);
}
-
+
break;

case "quit-application":
@@ -447,6 +447,14 @@
//tb3
showNewMailNotification(item);
},
+
+ msgsClassified: function(items,v1,v2){
+ //tb3 better way
+ for (var i = 0; i < items.length; i++) {
+ showNewMailNotification( items.queryElementAt(i, Components.interfaces.nsIMsgDBHdr) );
+ }
+ },
+

itemAdded: function(item){
//tb2
@@ -842,6 +848,9 @@
// has been moved to a new folder but is already read
return;
}
+ if ( hdr.getStringProperty("junkscore") != "" && hdr.getStringProperty("junkscore") != "0" ) {
+ return;
+ }
if (!isFolderEnabled(hdr) || !checkFolderName(hdr.folder.folderURL)) {
// folder has been choosen by the user to be disabled in the display
return;

Discussion