about summary refs log tree commit diff stats
path: root/src/xmpp/stanza.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-26 01:07:11 +0000
committerJames Booth <boothj5@gmail.com>2014-01-26 01:07:11 +0000
commitae1ccc7baeaff8afac2e72783f94da1fcfc38518 (patch)
tree47687e58755452b894ae5aa3ab42b580fe80ad63 /src/xmpp/stanza.c
parent16de26790678e55c10cc2ae79ac9a15234fe734e (diff)
downloadprofani-tty-ae1ccc7baeaff8afac2e72783f94da1fcfc38518.tar.gz
Add generated id to messages
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r--src/xmpp/stanza.c7
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);