RealRaven2000 / quickFilters

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

Filter Rules sorting - fails if no quickFilters Pro license #104

Closed RealRaven2000 closed 2 years ago

RealRaven2000 commented 2 years ago

When clicking "Sort" in Filter editor this only sorts the search terms if a valid pro license is present. There is also a message

image

Expected behavior: the message shows but the sorting feature works anyway.

Error log:

quickFilters 10:23:42.837 [21072 ms]
Could not retrieve bundle string: quickfilters.premium.title.sortSearchTerms quickFilters 10:23:42.837 [0 ms]
getIntPref(extensions.quickfilters.proNotify.sortSearchTerms.countDown) failed: Err:[Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getIntPref]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: chrome://quickfilters/content/qFilters-preferences.js :: getIntPref :: line 36" data: no]

RealRaven2000 commented 2 years ago

My guess is that it relies on saved "countdown" settings that are not generated in a fresh profile. The countdown feature was an attempt to convert some of the users to license buyers because people don't rally react to the Premium Feature notification. With custom templates you could generate a bunch, ignore the warning and then use them forever (even if you were blocked from creating more).

RealRaven2000 commented 2 years ago

I did some tests and fixed some problems with missing strings, but it turns out you cannot use sort filters without pro license at all. it's probably one of the reasons I actually sell licenses, so I don't want to change this behavior. However I need to change the notification text which reads:

{1} is a Premium feature, please get a quickFilters Pro License for using it permanently.

This is a generic error message that use for other features that have a "countdown" of uses, but here I need to drop "permanently". For full transparency, I should add - "You can use this feature N more times..."

RealRaven2000 commented 2 years ago

The old countDown code is actually broken. it doesn't assign the countDown from the default, resulting in the value to be set to -1 immediately:

  if (notifyBox) {
    let notificationKey = "quickfilters-proFeature",
        countDown = null;
    try {
      if (featureName.indexOf('Advanced search') == 0)
        featureName="advancedSearchType";
      prefs.getIntPref("proNotify." + featureName + ".countDown") ; 
      if (notifyBox.getNotificationWithValue(notificationKey)) {
        // notification is already shown on screen.
        util.logDebug('notifyBox for [' + notificationKey + '] is already displayed, no action necessary.\n'
                                   + 'Countdown is ' + countDown);
        return;
      }
      countDown--;
      prefs.setIntPref("proNotify." + featureName + ".countDown", countDown);
      util.logDebug('Showing notifyBox for [' + notificationKey + ']...\n'
                                 + 'Countdown is ' + countDown);
    }
RealRaven2000 commented 2 years ago

Here is a version with a more transparent (to be localized) message and a "real" new countdown for premium features:

quickFilters-wx-5.4.1pre51.zip

to install this prerelease, download the zip file and drag into Thunderbird Add-ons Manager (without extracting)

The message will be displayed per feature, looking like this:

image

RealRaven2000 commented 2 years ago

Fixed in 5.5 - released today