about summary refs log tree commit diff stats
path: root/src/xmpp/iq.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-03-24 17:27:30 +0000
committerJames Booth <boothj5@gmail.com>2013-03-24 17:27:30 +0000
commitd703301f7f26e6bee39a542167a92be9fd543ae8 (patch)
treec76b10ee6c2da483e85f2e360aefb631183e992d /src/xmpp/iq.c
parent2e12b1537728bf6ad3d91a917703a93abb88577d (diff)
downloadprofani-tty-d703301f7f26e6bee39a542167a92be9fd543ae8.tar.gz
Respond to disco info requests without node attribute
Diffstat (limited to 'src/xmpp/iq.c')
-rw-r--r--src/xmpp/iq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index 9976f5a7..ccffcde2 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -349,14 +349,16 @@ _iq_handle_discoinfo_get(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
     xmpp_stanza_t *incoming_query = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_QUERY);
     const char *node_str = xmpp_stanza_get_attribute(incoming_query, STANZA_ATTR_NODE);
 
-    if (from != NULL && node_str != NULL) {
+    if (from != NULL) {
         xmpp_stanza_t *response = xmpp_stanza_new(ctx);
         xmpp_stanza_set_name(response, STANZA_NAME_IQ);
         xmpp_stanza_set_id(response, xmpp_stanza_get_id(stanza));
         xmpp_stanza_set_attribute(response, STANZA_ATTR_TO, from);
         xmpp_stanza_set_type(response, STANZA_TYPE_RESULT);
         xmpp_stanza_t *query = caps_create_query_response_stanza(ctx);
-        xmpp_stanza_set_attribute(query, STANZA_ATTR_NODE, node_str);
+        if (node_str != NULL) {
+            xmpp_stanza_set_attribute(query, STANZA_ATTR_NODE, node_str);
+        }
         xmpp_stanza_add_child(response, query);
         xmpp_send(conn, response);