Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
RealRaven2000 opened this issue May 17, 2022 · 5 comments
Closed

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

RealRaven2000 opened this issue May 17, 2022 · 5 comments
Assignees
Labels

Comments

@RealRaven2000
Copy link
Owner

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
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

Fixed in 5.5 - released today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant