diff --git a/libnotify/notification.c b/libnotify/notification.c index 50dccfe..f7c2229 100644 --- a/libnotify/notification.c +++ b/libnotify/notification.c @@ -817,8 +817,29 @@ proxy_g_signal_cb (GDBusProxy *proxy, const char *id; const char *action; GVariant *parameter; + int i; g_variant_get (parameters, "(&s&s@av)", &id, &action, ¶meter); + + for (i = 0; i < g_variant_n_children (parameter); i++) { + g_autoptr (GVariant) data = NULL; + g_variant_get_child (parameter, i, "v", &data); + + if (g_variant_is_of_type (data, G_VARIANT_TYPE_VARDICT)) { + const char *key = NULL; + g_autoptr (GVariant) pdata = NULL; + + g_variant_get (data, "{&sv}", &key, &pdata); + + if (strcmp (key, "activation-token") == 0 && + g_variant_is_of_type (data, G_VARIANT_TYPE_STRING)) { + g_free (notification->priv->activation_token); + notification->priv->activation_token = g_variant_dup_string (pdata, NULL); + break; + } + } + } + g_variant_unref (parameter); notification_id = get_portal_notification_id (notification);