From 197b901fef2cc774ea0d4dd48ec8244da5bdf55c Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Fri, 3 Nov 2023 07:12:19 -0400 Subject: [PATCH] discovery: generate stanza id --- src/xmppipe.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xmppipe.c b/src/xmppipe.c index dd91db7..48a1e13 100644 --- a/src/xmppipe.c +++ b/src/xmppipe.c @@ -378,12 +378,15 @@ int xmppipe_stream_init(xmppipe_state_t *state) { int xmppipe_discovery_init(xmppipe_state_t *state) { xmpp_stanza_t *iq; xmpp_stanza_t *query; + char *id; iq = xmppipe_stanza_new(state->ctx); xmppipe_stanza_set_name(iq, "iq"); xmppipe_stanza_set_type(iq, "get"); xmppipe_stanza_set_attribute(iq, "to", state->server); - xmppipe_stanza_set_id(iq, "_xmppipe_disco_init"); + + id = xmppipe_uuid_gen(state->ctx); + xmppipe_stanza_set_id(iq, xmppipe_uuid_gen(state->ctx)); query = xmppipe_stanza_new(state->ctx); xmppipe_stanza_set_name(query, "query"); @@ -395,6 +398,8 @@ int xmppipe_discovery_init(xmppipe_state_t *state) { xmppipe_send(state, iq); (void)xmpp_stanza_release(iq); + xmpp_free(state->ctx, id); + return 0; }