Closed Bug 1835843 Opened 3 years ago Closed 3 years ago

Add wildcard support for messages.query(queryInfo.subject)

Categories

(Thunderbird :: Add-Ons: Extensions API, enhancement)

Thunderbird 102
Desktop
Windows 10
enhancement

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: mihaicodrean, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0

Steps to reproduce:

I'm using the messages.query API, and would like to filter by a subject prefix.

Actual results:

The results only include exact matches.

Expected results:

With proper API support, return all matches.

The existing code in ext-messages.js hints that this might already work:

            // Check subject (substring match).
            if (
              queryInfo.subject &&
              !msg.mime2DecodedSubject.includes(queryInfo.subject)
            ) {
              return false;
            }

OK, this is embarrassing, but I had double-quotes around the entire expression I was searching by, included in the actual string. Maybe I did that as an experiment (no pun) for the early API four years ago, as discussed here: https://bugzilla.mozilla.org/show_bug.cgi?id=1531317#c24

Please feel free to close/delete this bug report.

OS: Unspecified → Windows 10
Hardware: Unspecified → Desktop

(In reply to Mihai from comment #2)

I had double-quotes around the entire expression I was searching by, included in the actual string. Maybe I did that as an experiment (no pun) for the early API four years ago, as discussed here: https://bugzilla.mozilla.org/show_bug.cgi?id=1531317#c24

Or maybe that's how things worked in the API at some point... I can't remember.

In any case, it works as expected w/out the embedded quotes.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME

I cannot say something like that never happened to me :-)

Thanks for understanding. :-)

You need to log in before you can comment on or make changes to this bug.