From 470e237706d5f6c50b302285f98ee0d649d0e9a5 Mon Sep 17 00:00:00 2001 From: Chris Blake Date: Wed, 2 Feb 2022 05:02:36 -0500 Subject: [PATCH] Recorded applications that send notifications. --- data/notifications.gschema.xml | 8 ++++++++ src/DBus.vala | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/data/notifications.gschema.xml b/data/notifications.gschema.xml index 7ffe2f4c..6574c769 100644 --- a/data/notifications.gschema.xml +++ b/data/notifications.gschema.xml @@ -1,6 +1,10 @@ + + [] + Applications that have sent notifications. Used in the switchboard + false Disable all notifications @@ -24,5 +28,9 @@ true Show missed notifications in notification center + + true + Does a corresponding .desktop entry file exist + diff --git a/src/DBus.vala b/src/DBus.vala index 2ffbd735..12ca3af4 100644 --- a/src/DBus.vala +++ b/src/DBus.vala @@ -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),