RealRaven2000 / quickFilters

Thunderbird Add-on: quickFilters
http://quickfilters.quickfolders.org/
Other
46 stars 11 forks source link

Betterbird: With 2-way addresses make sure "any" operator is selected #101

Open RealRaven2000 opened 2 years ago

RealRaven2000 commented 2 years ago

In Betterbird, if we use the rule of 2-way addressing when creating filters through the assistant, for example through the rule "Based on Sender (from)", the operator "match all" is selected which doesn't make sense:

image

It should preselect "Match any" for the rules to work, like it does on Thunderbird ESR 91.8.1

To test behavior make sure "Disable two-way address search conditions" is deactivated on the Actions tab:

image

RealRaven2000 commented 2 years ago

Apparently the bug was in Betterbird and was just fixed.

To do: test for intelligent merging of search terms into correct subgroups depending on template. E.g. when adding a new "from" address to a filter that reads:

subject is X AND (from is A OR from is B)

merging a mail with sender "C" the expected result should be:

subject is X AND (from is A OR from is B OR from is C)

Also, if the original filter is

subject is X AND from is A

quickFilters should create a new subgroup:

for this to work it would have to find the last "from is ..." search term and check whether it is in an bracketed expression with an OR operator - if it is with an AND operation quickFilters could potentially create brackets and encapsulate it with the last "from terms":

subject is X AND (from is A OR from is C)

in every case the filter editor should be force-displayed to illustrate the different groupings (Mixing Any and All). It also needs to check whether the current App version supports this patch. I need to find out from @betterbird how to check this compatibility via function detection.

Betterbird commented 2 years ago

Apparently the bug was in Betterbird and was just fixed.

Sorry, since the first "latest build" release we found and fixed four bugs.

I need to find out from @Betterbird how to check this compatibility via function detection.

Maybe Thunderbird are taking the patch in https://bugzilla.mozilla.org/show_bug.cgi?id=297852, too early to tell.

BB will ship this functionality with 91.9 next week. If you want to distinguish BB from TB, check

console.log(AppConstants.MOZ_APP_DISPLAYNAME_DO_NOT_USE)
console.log(AppConstants.MOZ_APP_VERSION_DISPLAY)

The latter will contain the string "-bb", but perhaps the first one is the way to go.

RealRaven2000 commented 2 years ago

Apparently the bug was in Betterbird and was just fixed.

Sorry, since the first "latest build" release we found and fixed four bugs.

I need to find out from @Betterbird how to check this compatibility via function detection.

Maybe Thunderbird are taking the patch in https://bugzilla.mozilla.org/show_bug.cgi?id=297852, too early to tell.

BB will ship this functionality with 91.9 next week. If you want to distinguish BB from TB, check

console.log(AppConstants.MOZ_APP_DISPLAYNAME_DO_NOT_USE)
console.log(AppConstants.MOZ_APP_VERSION_DISPLAY)

The latter will contain the string "-bb", but perhaps the first one is the way to go.

Thanks, preferably is there any new attribute / function / interface in one of the search interfaces that I could use to check whether multi-operator is supported rather than rely on App/Version info? It's always extra work to know which app / fork / version supports what. If some flag / attribute could be added to the nsISearchTerm or filter interfaces then it would be more transparent. Not a must, but nice to have!

Betterbird commented 2 years ago

Hmm, well, our patch removes two APIs, is that of help? https://github.com/Betterbird/thunderbird-patches/blob/9011bd0d3c4f5afa7ce138e77190e3901812df7b/102/bugs/297852-grouping-search-term.patch#L1535

The first one is a dummy and the second one is a misnomer. It doesn't retrieve the search term.

RealRaven2000 commented 2 years ago

Hmm, well, our patch removes two APIs, is that of help? https://github.com/Betterbird/thunderbird-patches/blob/9011bd0d3c4f5afa7ce138e77190e3901812df7b/102/bugs/297852-grouping-search-term.patch#L1535

The first one is a dummy and the second one is a misnomer. It doesn't retrieve the search term.

Yes that's helpful, I can just do a simple:

let isMixedOperatorsSupport = (!targetFilter.AddTerm);

good job on uncluttering this. I think I made my own addTerm when I found that dummy...

Betterbird commented 2 years ago

BB will ship this functionality with 91.9 next week.

This is now shipping.