aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Krzyszkowiak <dos@dosowisko.net>2023-03-13 19:52:18 +0100
committerMarvin W <git@larma.de>2023-03-21 17:57:33 -0600
commit444275a99d659337bc808e5d6b75fc0ae40de499 (patch)
tree4b7d6d5631a144a1737fa0f2bbf21ccae5139598
parentecf94dd2e699302dabe1a0e0800c36e5455934f0 (diff)
downloaddino-444275a99d659337bc808e5d6b75fc0ae40de499.tar.gz
dino-444275a99d659337bc808e5d6b75fc0ae40de499.zip
FreeDesktopNotifier: Set notification categories
This provides notifications servers some context on how to handle the notification.
-rw-r--r--main/src/ui/notifier_freedesktop.vala6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/src/ui/notifier_freedesktop.vala b/main/src/ui/notifier_freedesktop.vala
index 8af96975..3f390102 100644
--- a/main/src/ui/notifier_freedesktop.vala
+++ b/main/src/ui/notifier_freedesktop.vala
@@ -94,6 +94,7 @@ 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());
+ hash_table["category"] = new Variant.string("im.received");
string[] actions = new string[] {"default", "Open conversation"};
try {
uint32 notification_id = yield dbus_notifications.notify("Dino", replace_id, "", conversation_display_name, body, actions, hash_table, -1);
@@ -120,6 +121,7 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object {
hash_table["sound-name"] = new Variant.string("phone-incoming-call");
hash_table["urgency"] = new Variant.byte(2);
hash_table["desktop-entry"] = new Variant.string(Dino.Application.get_default().get_application_id());
+ hash_table["category"] = new Variant.string("im");
string[] actions = new string[] {"default", "Open conversation", "reject", _("Reject"), "accept", _("Accept")};
try {
uint32 notification_id = yield dbus_notifications.notify("Dino", 0, "", summary, body, actions, hash_table, 0);
@@ -158,6 +160,7 @@ 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());
+ hash_table["category"] = new Variant.string("im");
string[] actions = new string[] {"default", "Open conversation", "accept", _("Accept"), "deny", _("Deny")};
try {
uint32 notification_id = yield dbus_notifications.notify("Dino", 0, "", summary, body, actions, hash_table, -1);
@@ -197,6 +200,7 @@ 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());
+ hash_table["category"] = new Variant.string("im.error");
try {
yield dbus_notifications.notify("Dino", 0, "im.dino.Dino", summary, body, new string[]{}, hash_table, -1);
} catch (Error e) {
@@ -217,6 +221,7 @@ 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());
+ hash_table["category"] = new Variant.string("im");
string[] actions = new string[] {"default", "", "reject", _("Reject"), "accept", _("Accept")};
try {
@@ -250,6 +255,7 @@ 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());
+ hash_table["category"] = new Variant.string("im");
string[] actions = new string[] {"deny", _("Deny"), "accept", _("Accept")};
try {