send NameOwnerChanged for unique name assignment too

This commit is contained in:
hippoz 2023-01-15 04:49:03 +02:00
parent adc299c847
commit 3f88fe4701
Signed by: hippoz
GPG key ID: 56C4E02A85F2FBED

View file

@ -416,6 +416,15 @@ int handle_hello(bus_t *s, int i, wire_message_t *msg, wire_context_t *ctx, wire
TRYPTR(wire_set_string(reply_ctx, s->names[unique_name_index].name));
} _reply_end()
_signal_begin("sss", "NameOwnerChanged") {
/* Name with a new owner */
TRYPTR(wire_set_string(&signal_reply_ctx, s->names[unique_name_index].name));
/* Old owner or empty string if none */
TRYPTR(wire_set_string(&signal_reply_ctx, ""));
/* New owner or empty string if none */
TRYPTR(wire_set_string(&signal_reply_ctx, ""));
} _signal_end();
printf("assigned unique name '%s' to connection %d\n", s->names[unique_name_index].name, i);
return 0;
}