aboutsummaryrefslogtreecommitdiff
path: root/src/notifications.cpp
diff options
context:
space:
mode:
authorArthur Mello <arthur.mello@canonical.com>2016-06-29 21:37:56 -0300
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-29 14:37:39 +0200
commitf42d0a01dcbd66920f65d1e5bd784914a797d773 (patch)
treec7b060be21ebc32bf85b8e038008cf814b6393db /src/notifications.cpp
parentc12e9b28189aa11a28ca883cc4d5ecb4da57db7c (diff)
downloadayatana-indicator-datetime-f42d0a01dcbd66920f65d1e5bd784914a797d773.tar.gz
ayatana-indicator-datetime-f42d0a01dcbd66920f65d1e5bd784914a797d773.tar.bz2
ayatana-indicator-datetime-f42d0a01dcbd66920f65d1e5bd784914a797d773.zip
Fix notifications so it respects if it should or not show bubbles or add to notification list
Diffstat (limited to 'src/notifications.cpp')
-rw-r--r--src/notifications.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/notifications.cpp b/src/notifications.cpp
index 3c90e57..4a2c846 100644
--- a/src/notifications.cpp
+++ b/src/notifications.cpp
@@ -63,6 +63,8 @@ public:
std::vector<std::pair<std::string,std::string>> m_actions;
std::function<void(const std::string&)> m_closed_callback;
std::function<void()> m_timeout_callback;
+ bool m_show_notification_bubble;
+ bool m_post_to_messaging_menu;
};
Builder::Builder():
@@ -128,6 +130,18 @@ Builder::set_start_time (uint64_t time)
impl->m_start_time = time;
}
+void
+Builder::set_show_notification_bubble (bool show)
+{
+ impl->m_show_notification_bubble = show;
+}
+
+void
+Builder::set_post_to_messaging_menu (bool post)
+{
+ impl->m_post_to_messaging_menu = post;
+}
+
/***
****
***/
@@ -265,6 +279,11 @@ public:
g_signal_connect (nn.get(), "closed",
G_CALLBACK(on_notification_closed), this);
+ if (!info.m_show_notification_bubble) {
+ post(info);
+ return ret;
+ }
+
GError * error = nullptr;
if (notify_notification_show(nn.get(), &error))
{
@@ -284,6 +303,10 @@ public:
std::string post(const Builder::Impl& data)
{
+ if (!data.m_post_to_messaging_menu) {
+ return "";
+ }
+
if (!m_messaging_app) {
return std::string();
}