Skip to content

Commit

Permalink
notification: Use categories from xdg desktop notification spec
Browse files Browse the repository at this point in the history
The xdg spec¹ uses slightly different names thus making it hard for apps
to use API like `g_notification_set_category` 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 <[email protected]>
  • Loading branch information
agx committed Oct 31, 2024
1 parent 4f928ee commit 523f4bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,11 +889,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",
Expand Down
2 changes: 1 addition & 1 deletion tests/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 523f4bf

Please sign in to comment.