This week in LeechCraft:

Advanced Notifications

And there is another change, even more technical, so we’ve decided to move it out of the list. We’ve begun the work on the Advanced Notifications framework, an upgrade to existing notifications framework, that would allow to implement persistent notifications, notifications grouping and reducing, and a lot of other tasty things. Let’s overview them briefly.

Persistent notifications

Up until now, a notification was only shown by system means (via libnotify) or by our nice Kinotify plugin, but after the notification had disappeared, user had no way of knowing that something had occured.

Persistent notifications fix that. They allow, for example, to implement a plugin that would collect events like incoming unread messages, conference highlights or incoming file transfer requests and display a persistent notification (for example, as an icon in the system tray) for them until the user reacts to the event or manually dismisses the notification.

So, yes, we will finally have a system tray icon for new incoming messages in Azoth.

Notifications grouping

Advanced Notifications carry informating about their category, type, Semantic Event ID (SEID), and such. This way, it is possible to group all notifications from a single category into one tray icon or menu, for example. This way, notifications from our IM client and from a hypothetical Twitter client could be all placed into one menu of one icon. Of course, with a proper plugin, user is able to tweak the settings of grouping.

Notification category is the most general grouping criteria. For example, it could be IM, File download, News, and such. Type is used for more precise categorization withing a category. For example, for an IM-category notification it could be IncomingMessage, IncomingMUCMessage, FileTransferRequest, AttentionRequest or AuthorizationRequest. Event ID is used for extremely fine-grained categorization (and some other tasks). For example, event ID would be the same for two messages coming from the same IM contact, but incoming message notification and file transfer request notification have different event IDs event if they originate from the same contact.

Notifications reducing

Up until now a plugin that displays notifications had no way of knowing if two notifications actually notify about the same thing, and if an IM client sends out a hundred notifications about new messages from a single contact, you would have to click trough all those notifications, despite they are semantically equivalent.

Now, thanks to event IDs, a proper notification plugin can detect that there is no need in displaying next 99 notifications after first one about new incoming messages has been shown.

Actions

Of course, notifications carry actions with them. So, you could open a chat or grant authorization right from the persistent notifications’ menu.

Customizability

Advanced Notifications carry a lot of context information, like source contact, contact group, message body and such for an IM message notification. This allows to configure how an Advanced Notifications plugin would notify about different events.

For example, it would be possible to configure the plugin so that visual notifications are displayed for every message in your favorite conference, and sound is played only for incoming messages from contacts in “Personal” group, and attention requests are ignored for all contacts except the one with JID yourgf@gmail.com, and all notifications from contacts in group “Bots” are ignored at all, but only if the message doesn’t contain the word “LeechCraft”.

Of course, different plugins which are the sources of notifications can expose different context information, since an RSS reader, for example, has completely different set of parameters than an IM client, and, in fact, all those parameters aren’t known to the notificator in compile-time. For that, notification source plugins must also implement an interface that allows them to provide semantics of those parameters, so an Advanced Notifications plugin is able to provide a sensible GUI for configuring the rules.

Try it out!

If you want to be on the bleeding edge and see how Advanced Notifications framework is progressing, you can build the Advanced Notifications plugin from our git by passing -DENABLE_ADVANCEDNOTIFICATIONS=True flag to cmake, since this plugin is disabled by default. Please note that it depends heavily on the API and implementation of LeechCraft, so it’s better to build LeechCraft itself from source as well.

Currently only Azoth supports some basic Advanced Notifications, and only tray notifications are working.