diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2016-02-01 18:05:45 -0600 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-06-30 02:03:35 +0200 |
commit | b4ff1a2458802e3238d952c69f9dd664f013137b (patch) | |
tree | 8ec4e5d24a0aecc38a839bf8251f82928d5c31d4 /src/snap.cpp | |
parent | 1d0fd8903feb10941fc4d0ed387b0a1e2d8b35ae (diff) | |
download | ayatana-indicator-datetime-b4ff1a2458802e3238d952c69f9dd664f013137b.tar.gz ayatana-indicator-datetime-b4ff1a2458802e3238d952c69f9dd664f013137b.tar.bz2 ayatana-indicator-datetime-b4ff1a2458802e3238d952c69f9dd664f013137b.zip |
don't show calendar event notifications if com.ubuntu.calendar's notifications are blacklisted
Diffstat (limited to 'src/snap.cpp')
-rw-r--r-- | src/snap.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/snap.cpp b/src/snap.cpp index f0300af..934ad19 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -84,6 +84,12 @@ public: appointment_func snooze, appointment_func ok) { + // If calendar notifications are muted, don't show them + if (!appointment.is_ubuntu_alarm() && calendar_events_are_muted()) { + g_debug("Skipping muted calendar event '%s' notification", appointment.summary.c_str()); + return; + } + /* Alarms and calendar events are treated differently. Alarms should require manual intervention to dismiss. Calendar events are less urgent and shouldn't require manual @@ -159,6 +165,17 @@ public: private: + bool calendar_events_are_muted() const + { + for(const auto& app : m_settings->muted_apps.get()) { + if (app.first == "com.ubuntu.calendar") { + return true; + } + } + + return false; + } + static void on_sound_proxy_ready(GObject* /*source_object*/, GAsyncResult* res, gpointer gself) { GError * error; |