From ac28abbadf0070ad6a84ab2f7306f30538208ae1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 9 Feb 2024 12:50:46 +0100 Subject: [PATCH] metadata: handle removed globals as well When we remove a global, we set NULL,NULL,NULL as its metadata. This then results in the implementor of the metadata to emit the property change event for the subject. When we decide to propagate this event to the listeners we not only need to check if the client can see the global but also if the global was removed and this is a remove metadata event. Fixes metadata remove events when a global is removed. --- src/modules/module-metadata/metadata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/module-metadata/metadata.c b/src/modules/module-metadata/metadata.c index a1b839227..8d85ac8cf 100644 --- a/src/modules/module-metadata/metadata.c +++ b/src/modules/module-metadata/metadata.c @@ -51,7 +51,9 @@ static int metadata_property(void *data, struct impl *impl = d->impl; if (impl->pending == 0 || d->pong_seq != 0) { - if (pw_impl_client_check_permissions(client, subject, PW_PERM_R) >= 0) + int res = pw_impl_client_check_permissions(client, subject, PW_PERM_R); + if (res >= 0 || + (res == -ENOENT && key == NULL && type == NULL && value == NULL)) pw_metadata_resource_property(d->resource, subject, key, type, value); } return 0;