summaryrefslogtreecommitdiff
path: root/src/notifications/notifier_gio.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-03-16 21:15:56 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2023-03-16 21:15:56 -0400
commit02f7bfefe3185a38f8935b31c68857b986d709ac (patch)
tree37e481cd52e13bf864ac88dca5a6943cc7ac4585 /src/notifications/notifier_gio.cpp
parentb83bf2a622ecfb667cc89909ebae9180ed5ac117 (diff)
downloadabaddon-portaudio-02f7bfefe3185a38f8935b31c68857b986d709ac.tar.gz
abaddon-portaudio-02f7bfefe3185a38f8935b31c68857b986d709ac.zip
withdraw notifications on channel open
Diffstat (limited to 'src/notifications/notifier_gio.cpp')
-rw-r--r--src/notifications/notifier_gio.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/notifications/notifier_gio.cpp b/src/notifications/notifier_gio.cpp
index e5335d0..ed17ad1 100644
--- a/src/notifications/notifier_gio.cpp
+++ b/src/notifications/notifier_gio.cpp
@@ -18,7 +18,7 @@ Notifier::~Notifier() {
#endif
}
-void Notifier::Notify(const Glib::ustring &title, const Glib::ustring &text, const Glib::ustring &default_action, const std::string &icon_path) {
+void Notifier::Notify(const Glib::ustring &id, const Glib::ustring &title, const Glib::ustring &text, const Glib::ustring &default_action, const std::string &icon_path) {
auto n = Gio::Notification::create(title);
n->set_body(text);
n->set_default_action(default_action);
@@ -29,7 +29,7 @@ void Notifier::Notify(const Glib::ustring &title, const Glib::ustring &text, con
auto *icon = g_file_icon_new(file);
g_notification_set_icon(n->gobj(), icon);
- Abaddon::Get().GetApp()->send_notification(n);
+ Abaddon::Get().GetApp()->send_notification(id, n);
g_object_unref(icon);
g_object_unref(file);
@@ -38,3 +38,7 @@ void Notifier::Notify(const Glib::ustring &title, const Glib::ustring &text, con
ma_engine_play_sound(&m_engine, Abaddon::Get().GetResPath("/sound/message.mp3").c_str(), nullptr);
#endif
}
+
+void Notifier::Withdraw(const Glib::ustring &id) {
+ Abaddon::Get().GetApp()->withdraw_notification(id);
+}