"Junk" status of a message is hidden from Add-Ons
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(Not tracked)
People
(Reporter: martin, Assigned: darktrojan)
Details
Attachments
(1 file, 1 obsolete file)
4.29 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Waterfox/56.3
Steps to reproduce:
I wrote an Add-On which searches for messages marked as "junk" by using "browser.messages.list(...)" to get a list of all messages in a folder and then the "junk" tag in the "page.messages[n].tags[]" array for a tag named "junk".
Actual results:
In Thunderbird 68.4.1, the "page.messages[n].tags[]" array is empty for ALL messages.
This has the effect that ALL messages are detected as "NOT marked as junk" by the Add-On. Therefore the Add-On does not work correctly.
Expected results:
In an older Thunderbird 68.x version (I don't remember which version in the range 68.0-68.4.0), the "page.messages[n].tags[]" array contained a tag "junk" if the message was marked as "junk". This allowed the Add-On to detect messages that are marked as "junk".
Updated•5 years ago
|
Reporter | ||
Comment 1•5 years ago
|
||
I found out the change that causes the problem:
In file "chrome/messenger/content/messenger/parent/ext-mail.js", function "convertMessage()", line 1354 has been inserted:
messageObject.tags = tags.filter(MailServices.tags.isValidKey);
This line will remove the tag "junk"
from the array tags[]
before writing it to messageObject.tags
.
I don't know if this effect is desired. If yes, an additional property should be added to messageObject
that allows checking an add-on if a message is marked as junk or not.
Example: messageObject.isJunk = ...
However, this change would require all add-ons that check the junk status of messages to be re-written.
Assignee | ||
Comment 2•5 years ago
|
||
That add-ons could see the junk status in this way was unintended. I will add a junk property to the message object as that is a useful thing to know, and it can already be set and removed.
Assignee | ||
Comment 3•5 years ago
|
||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
AFAICT, junkScore is either 0 or 100. Which seems a bit weird to me.
Comment 6•5 years ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #5)
AFAICT, junkScore is either 0 or 100. Which seems a bit weird to me.
I'm sure there's some history behind that. Not sure who'd remember.
Comment 7•5 years ago
|
||
Would have to dig deeper to verify but I think 0 and 100 are the ones you get if you set something to ham or spam. For classification in general, all it takes to make it spam is that it's above mail.adaptivefilters.junk_threshold (90 by default).
Assignee | ||
Comment 8•5 years ago
|
||
Let's not check this in then. I'll come back to it.
I have been in the process of moving an addon to the new api (with no XUL)...... I have been real happy with the progress.
and then got stuck at no junkScore or junk status being available in the api. I could work with either, but was using junkscore in the past.
Assignee | ||
Comment 10•5 years ago
|
||
Now with junk score.
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/66070529eac2
Add junk and junkScore properties to message objects that are returned from APIs. r=mkmelin DONTBUILD
Updated•5 years ago
|
Description
•