From fd269cd814bc68a35a8ac47a36c9f0476b4edb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Thu, 31 Oct 2024 09:54:31 +0100 Subject: [PATCH] notification: Use categories from xdg desktop notification spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The xdg spec¹ uses slightly different names thus making it hard for apps to use API in a way that works for portaled and non-portaled use cases. It also makes things slighlty more consistent as the current call.* sub-categories (`.incoming`, `.ongoing`) indicate a state while the `im` category indicates a type (`message`). 1) https://specifications.freedesktop.org/notification-spec/1.2/categories.html Signed-off-by: Guido Günther --- data/org.freedesktop.portal.Notification.xml | 4 ++-- src/notification.c | 4 ++-- tests/notification.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/org.freedesktop.portal.Notification.xml b/data/org.freedesktop.portal.Notification.xml index 9474aa6b1..0e667be80 100644 --- a/data/org.freedesktop.portal.Notification.xml +++ b/data/org.freedesktop.portal.Notification.xml @@ -279,7 +279,7 @@ The following categories are standarized so far: - * ``im.message`` + * ``im.received`` Intended for instant messaging apps displaying notifications for new messages. @@ -331,7 +331,7 @@ Disable the speakerphone for the ongoing call. - * ``call.missed`` + * ``call.unanswered`` Intended to be used by call apps when a call was missed. diff --git a/src/notification.c b/src/notification.c index 156d4b2f8..eac77eaa9 100644 --- a/src/notification.c +++ b/src/notification.c @@ -877,11 +877,11 @@ parse_category (GVariantBuilder *builder, { const char *category; const char *supported_categories[] = { - "im.message", + "im.received", "alarm.ringing", "call.incoming", "call.ongoing", - "call.missed", + "call.unanswered", "weather.warning.extreme", "cellbroadcast.danger.extreme", "cellbroadcast.danger.severe", diff --git a/tests/notification.c b/tests/notification.c index 57a0ee834..7fd127736 100644 --- a/tests/notification.c +++ b/tests/notification.c @@ -515,7 +515,7 @@ test_notification_category (void) notification_s = "{ 'title': <'test notification 5'>, " " 'body': <'test notification body 5'>, " - " 'category': <'im.message'>" + " 'category': <'im.received'>" "}"; run_notification_test ("test5", notification_s, NULL, FALSE);