Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow up notification v2 #1504

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions data/org.freedesktop.portal.Notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
notification server to treat the button specially.

Depending on the ``purpose`` other fields of the button may be ignored.
If the server doesn't understand the ``purpose` it will be
If the server doesn't understand the ``purpose`` it will be
ignored and the button will be shown as a normal button.

Most standardized hints are defined as part of a ``category``.
Expand All @@ -208,18 +208,18 @@

The following purposes are defined outside of a ``category``:

* ``system.custom-alert``:
* ``system.custom-alert``:

Not a button in a strict sense. This action may be called,
depending on system policies, automatically by the notification
server whenever the notification is shown.
Not a button in a strict sense. This action may be called,
depending on system policies, automatically by the notification
server whenever the notification is shown.

This allows apps to use custom methods for notifying the user,
for example, to play audio from a special
source like a streaming service or a radio station.
This allows apps to use custom methods for notifying the user,
for example, to play audio from a special
source like a streaming service or a radio station.

No ``label`` should be given when this purpose is used, so that
the server can ignore the button if it doesn't understand the purpose.
No ``label`` should be given when this purpose is used, so that
the server can ignore the button if it doesn't understand the purpose.

* ``display-hint`` (``as``)

Expand Down Expand Up @@ -319,11 +319,11 @@

This type has the following button purposes:

* ``call.hang-up``:
* ``call.hang-up``:

Hang up the ongoing call.
Hang up the ongoing call.

* ``call.enable-speakerphone``:
* ``call.enable-speakerphone``:

Enable the speakerphone for the ongoing call.

Expand Down
14 changes: 12 additions & 2 deletions tests/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,20 +541,30 @@ void
test_notification_supported_properties (void)
{
g_autoptr(XdpPortal) portal = NULL;
const char *expected_serialized;
g_autoptr(GKeyFile) keyfile = NULL;
g_autoptr(GError) error = NULL;
g_autofree char *path = NULL;
g_autoptr(GVariant) expected_response = NULL;
g_autoptr(GVariant) response = NULL;

keyfile = g_key_file_new ();

g_key_file_set_string (keyfile, "notification", "supported-options", "{ 'something': <'sdfs'> }");
expected_serialized = "{ 'something': <'sdfs'> }";
g_key_file_set_string (keyfile, "notification", "supported-options", expected_serialized);

path = g_build_filename (outdir, "notification", NULL);
g_key_file_save_to_file (keyfile, path, &error);
g_assert_no_error (error);

/* Wait for the backend to update the supported options */
sleep (1);

portal = xdp_portal_new ();

xdp_portal_get_supported_options (portal);
response = xdp_portal_get_supported_notification_options (portal, &error);
g_assert_no_error (error);
expected_response = g_variant_parse (G_VARIANT_TYPE_VARDICT, expected_serialized, NULL, NULL, NULL);
g_assert_true (g_variant_equal (expected_response, response));
}
#endif
Loading