Allow specifying whether ignored_categories preference should be considered when using showNotification()
Background
We have yet to decouple notification types from the various behaviors that are associated with them (e.g. how notifications are displayed, their priority, whether user can opt out of them). That means that any deviation from the behavior of existing notification types requires creating a new one, which can be quite troublesome. Since we're already deviating from their expected behavior when showing notifications via showNotification(), we'd like to keep using it to show notifications with the same type but one with and one without considering the ignored_categories preference that allows users to stop seeing notifications.
See discussion.
What to change
- Extend
showNotification()function lib/notifications.js to accept an additional object parameter for passing various options. - When passing the option
ignorable: true, check the value of theignored_categoriespreference to determine whether or not to show the notification.