Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions data/notifications.gschema.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema path="/io/elementary/notifications/" id="io.elementary.notifications">
<key type="as" name="applications">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same name as an existing subfolder which might be confusing. Not sure what a better name would be. Maybe "notifying-applications"?

<default>[]</default>
<summary>Applications that have sent notifications. Used in the switchboard</summary>
</key>
<key type="b" name="do-not-disturb">
<default>false</default>
<summary>Disable all notifications</summary>
Expand All @@ -24,5 +28,9 @@
<default>true</default>
<summary>Show missed notifications in notification center</summary>
</key>
<key type="b" name="has-app">
<default>true</default>
<summary>Does a corresponding .desktop entry file exist</summary>
</key>
</schema>
</schemalist>
6 changes: 6 additions & 0 deletions src/DBus.vala
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ public class Notifications.Server : Object {
} else {
var notification = new Notifications.Notification (app_name, app_icon, summary, body, actions, hints);

var apps = settings.get_strv("applications");
if (!(notification.app_id in apps)) {
apps += notification.app_id;
settings.set_strv("applications", apps);
}

if (!settings.get_boolean ("do-not-disturb") || notification.priority == GLib.NotificationPriority.URGENT) {
var app_settings = new GLib.Settings.full (
SettingsSchemaSource.get_default ().lookup ("io.elementary.notifications.applications", true),
Expand Down