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.
This commit is contained in:
Wim Taymans 2024-02-09 12:50:46 +01:00
parent acf9b67067
commit c972405cfe

View file

@ -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;