diff options
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r-- | src/xmpp/stanza.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 635d12db..5249d51b 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -115,7 +115,7 @@ stanza_create_chat_state(xmpp_ctx_t *ctx, const char * const recipient, xmpp_stanza_t * stanza_create_message(xmpp_ctx_t *ctx, const char * const recipient, const char * const type, const char * const message, - const char * const state, const char * const id) + const char * const state) { xmpp_stanza_t *msg, *body, *text; @@ -123,9 +123,8 @@ stanza_create_message(xmpp_ctx_t *ctx, const char * const recipient, xmpp_stanza_set_name(msg, STANZA_NAME_MESSAGE); xmpp_stanza_set_type(msg, type); xmpp_stanza_set_attribute(msg, STANZA_ATTR_TO, recipient); - if (id != NULL) { - xmpp_stanza_set_id(msg, id); - } + char *id = generate_unique_id(NULL); + xmpp_stanza_set_id(msg, id); body = xmpp_stanza_new(ctx); xmpp_stanza_set_name(body, STANZA_NAME_BODY); |