var msgFolderNotificationService = Components.classes["@mozilla.org/
messenger/msgnotificationservice;1"].
getService
(Components.interfaces.nsIMsgFolderNotificationService);
msgFolderNotificationService.addListener(myInboxListener);
The listener appears to be working fine. I created a variable called
myInboxListener and added an alert to the itemAdded function. The
alert pops up fine to tell me I have a new message. I am trying to
determine if Thunderbird has marked this message as junk. When the
alert first pops up, I can see that the message is sitting in the
inbox. I can also see that Thunderbird has already marked this message
as junk. It just has not moved it to the junk folder yet. I have found
an isRead property for the message that can tell me if the message has
been read or not. Code for variable like so:
var mgFolderListener = {
itemAdded: function(item)
{
if (item instanceof Components.interfaces.nsIMsgDBHdr)
{
alert("Has message been read" + item.isRead);
}
}
}
My question, is there a property to see if Thunderbird has marked this
as junk or not? I would greatly appreciate any help. Thanks in
advance.
Matthew Grant
I found another article mentioning this same thing at:
http://groups.google.com/group/mozilla.dev.apps.thunderbird/browse_thread/thread/777f01b927f2498d/3b3f3d36b82c46e5?lnk=gst&q=junk#3b3f3d36b82c46e5
That article is correct. But to clarify, junk status is determined by
the message header property "junkscore". It can have one of three string
values: "100" means the message is junk, "0" means not junk, and null or
blank means the message has not been evaluated. From your previous code
example, where "item" is an nsIMsgDBHdr object, you read the junkscore
in js using:
junkscore = item.getStringProperty("junkscore");
It's a little confusing, because the property was defined long ago as a
string, and given numerical "values", but it is really a tristate.
rkent