aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2021-04-07 21:27:50 +0200
committerfiaxh <git@lightrise.org>2021-04-07 21:31:47 +0200
commit332c772fbefc1c27a5021e18a58f333b802bdaaf (patch)
treea2933b9d9479fc6c8083416c29324fb6d5de40b0 /main/src/ui
parent4ce2bd8cd2cb100c45589bab4bc9c10c1db659cb (diff)
downloaddino-332c772fbefc1c27a5021e18a58f333b802bdaaf.tar.gz
dino-332c772fbefc1c27a5021e18a58f333b802bdaaf.zip
Let freedesktop notifications expire
fixes #1026
Diffstat (limited to 'main/src/ui')
-rw-r--r--main/src/ui/notifier_freedesktop.vala15
1 files changed, 10 insertions, 5 deletions
diff --git a/main/src/ui/notifier_freedesktop.vala b/main/src/ui/notifier_freedesktop.vala
index 00ba0d06..ecb5dc66 100644
--- a/main/src/ui/notifier_freedesktop.vala
+++ b/main/src/ui/notifier_freedesktop.vala
@@ -96,9 +96,10 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object {
uint32 replace_id = content_notifications.has_key(conversation) ? content_notifications[conversation] : 0;
HashTable<string, Variant> hash_table = new HashTable<string, Variant>(null, null);
hash_table["image-data"] = yield get_conversation_icon(conversation);
+ hash_table["desktop-entry"] = new Variant.string(Dino.Application.get_default().get_application_id());
string[] actions = new string[] {"default", "Open conversation"};
try {
- uint32 notification_id = dbus_notifications.notify("Dino", replace_id, "", conversation_display_name, body, actions, hash_table, 0);
+ uint32 notification_id = dbus_notifications.notify("Dino", replace_id, "", conversation_display_name, body, actions, hash_table, -1);
content_notifications[conversation] = notification_id;
add_action_listener(notification_id, "default", () => {
@@ -115,9 +116,10 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object {
HashTable<string, Variant> hash_table = new HashTable<string, Variant>(null, null);
hash_table["image-data"] = yield get_conversation_icon(conversation);
+ hash_table["desktop-entry"] = new Variant.string(Dino.Application.get_default().get_application_id());
string[] actions = new string[] {"default", "Open conversation", "accept", _("Accept"), "deny", _("Deny")};
try {
- uint32 notification_id = dbus_notifications.notify("Dino", 0, "", summary, body, actions, hash_table, 0);
+ uint32 notification_id = dbus_notifications.notify("Dino", 0, "", summary, body, actions, hash_table, -1);
if (!conversation_notifications.has_key(conversation)) {
conversation_notifications[conversation] = new ArrayList<uint32>();
@@ -151,8 +153,9 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object {
}
HashTable<string, Variant> hash_table = new HashTable<string, Variant>(null, null);
+ hash_table["desktop-entry"] = new Variant.string(Dino.Application.get_default().get_application_id());
try {
- dbus_notifications.notify("Dino", 0, "im.dino.Dino", summary, body, new string[]{}, hash_table, 0);
+ dbus_notifications.notify("Dino", 0, "im.dino.Dino", summary, body, new string[]{}, hash_table, -1);
} catch (Error e) {
warning("Failed showing connection error notification: %s", e.message);
}
@@ -170,10 +173,11 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object {
HashTable<string, Variant> hash_table = new HashTable<string, Variant>(null, null);
hash_table["image-data"] = yield get_conversation_icon(direct_conversation);
+ hash_table["desktop-entry"] = new Variant.string(Dino.Application.get_default().get_application_id());
string[] actions = new string[] {"default", "", "reject", _("Reject"), "accept", _("Accept")};
try {
- uint32 notification_id = dbus_notifications.notify("Dino", 0, "", summary, body, actions, hash_table, 0);
+ uint32 notification_id = dbus_notifications.notify("Dino", 0, "", summary, body, actions, hash_table, -1);
Conversation group_conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(room_jid, account, Conversation.Type.GROUPCHAT);
add_action_listener(notification_id, "default", () => {
@@ -202,10 +206,11 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object {
HashTable<string, Variant> hash_table = new HashTable<string, Variant>(null, null);
hash_table["image-data"] = yield get_conversation_icon(conversation);
+ hash_table["desktop-entry"] = new Variant.string(Dino.Application.get_default().get_application_id());
string[] actions = new string[] {"deny", _("Deny"), "accept", _("Accept")};
try {
- uint32 notification_id = dbus_notifications.notify("Dino", 0, "", summary, body, actions, hash_table, 0);
+ uint32 notification_id = dbus_notifications.notify("Dino", 0, "", summary, body, actions, hash_table, -1);
add_action_listener(notification_id, "accept", () => {
GLib.Application.get_default().activate_action("accept-voice-request", new Variant.int32(conversation.id));