about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-07-22 22:48:37 +0100
committerJames Booth <boothj5@gmail.com>2015-07-22 22:48:37 +0100
commitf9a7e35001107dcbd3e03f24833478cf869caf5a (patch)
treee3b0db8eaf8c93a9289c2c0100585028e67976bb /src/xmpp
parentfceec61a2c5cc323b4f7c1a8b4ffbe01b458c781 (diff)
downloadprofani-tty-f9a7e35001107dcbd3e03f24833478cf869caf5a.tar.gz
Added id attributes to roster queries
fixes #596
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/roster.c11
-rw-r--r--src/xmpp/stanza.c4
2 files changed, 11 insertions, 4 deletions
diff --git a/src/xmpp/roster.c b/src/xmpp/roster.c
index 5c9fa5d4..84a88d62 100644
--- a/src/xmpp/roster.c
+++ b/src/xmpp/roster.c
@@ -102,7 +102,9 @@ roster_send_add_new(const char * const barejid, const char * const name)
 {
     xmpp_conn_t * const conn = connection_get_conn();
     xmpp_ctx_t * const ctx = connection_get_ctx();
-    xmpp_stanza_t *iq = stanza_create_roster_set(ctx, NULL, barejid, name, NULL);
+    char *id = create_unique_id("roster");
+    xmpp_stanza_t *iq = stanza_create_roster_set(ctx, id, barejid, name, NULL);
+    free(id);
     xmpp_send(conn, iq);
     xmpp_stanza_release(iq);
 }
@@ -122,8 +124,9 @@ roster_send_name_change(const char * const barejid, const char * const new_name,
 {
     xmpp_conn_t * const conn = connection_get_conn();
     xmpp_ctx_t * const ctx = connection_get_ctx();
-    xmpp_stanza_t *iq = stanza_create_roster_set(ctx, NULL, barejid, new_name,
-        groups);
+    char *id = create_unique_id("roster");
+    xmpp_stanza_t *iq = stanza_create_roster_set(ctx, id, barejid, new_name, groups);
+    free(id);
     xmpp_send(conn, iq);
     xmpp_stanza_release(iq);
 }
@@ -354,4 +357,4 @@ _get_groups_from_item(xmpp_stanza_t *item)
     }
 
     return groups;
-}
\ No newline at end of file
+}
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c
index ed188a3b..be85c330 100644
--- a/src/xmpp/stanza.c
+++ b/src/xmpp/stanza.c
@@ -373,6 +373,10 @@ stanza_create_roster_remove_set(xmpp_ctx_t *ctx, const char * const barejid)
     xmpp_stanza_set_name(iq, STANZA_NAME_IQ);
     xmpp_stanza_set_type(iq, STANZA_TYPE_SET);
 
+    char *id = create_unique_id("roster");
+    xmpp_stanza_set_id(iq, id);
+    free(id);
+
     xmpp_stanza_t *query = xmpp_stanza_new(ctx);
     xmpp_stanza_set_name(query, STANZA_NAME_QUERY);
     xmpp_stanza_set_ns(query, XMPP_NS_ROSTER);