notify-send: Check for notification server actions capability support

This commit is contained in:
Ben Blain 2021-03-09 15:44:46 +00:00 committed by Marco Trevisan (Treviño)
parent 6c707d2dfd
commit 12d4b90623
1 changed files with 17 additions and 1 deletions

View File

@ -313,11 +313,27 @@ main (int argc, char *argv[])
}
if (actions != NULL) {
GList *server_caps = notify_get_server_caps ();
gint i = 0;
char *action = NULL;
gchar **spl = NULL;
gboolean have_actions;
while ((action = actions[i++])) {
have_actions =
!!g_list_find_custom (server_caps,
"actions",
(GCompareFunc) g_ascii_strcasecmp);
g_list_foreach (server_caps, (GFunc) g_free, NULL);
g_list_free (server_caps);
if (!have_actions) {
g_printerr (N_("Actions are not supported by this "
"notifications server. "
"Displaying non-interactively.\n"));
show_error = TRUE;
}
while (have_actions && (action = actions[i++])) {
gchar *name;
const gchar *label;