about summary refs log tree commit diff stats
path: root/src/xmpp/iq.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-06-29 22:52:45 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-06-29 22:52:45 +0200
commit2f5aa124cacae454e4b49c2ecbc7ca72bdf63d1c (patch)
tree1ea78bfc99bbc6ff917bd7de78f5ed0d53e2d1da /src/xmpp/iq.c
parent3c648ee2f5715998e440c316ea9eadfd8205463c (diff)
downloadprofani-tty-2f5aa124cacae454e4b49c2ecbc7ca72bdf63d1c.tar.gz
XEP-0157: Parse contact address stanza
Diffstat (limited to 'src/xmpp/iq.c')
-rw-r--r--src/xmpp/iq.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index beecb97e..7af477e6 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -2308,6 +2308,8 @@ _disco_info_response_id_handler(xmpp_stanza_t* const stanza, void* const userdat
         GSList* features = NULL;
         while (child) {
             const char* stanza_name = xmpp_stanza_get_name(child);
+            const char* child_type = xmpp_stanza_get_type(child);
+
             if (g_strcmp0(stanza_name, STANZA_NAME_FEATURE) == 0) {
                 const char* var = xmpp_stanza_get_attribute(child, STANZA_ATTR_VAR);
                 if (var) {
@@ -2315,10 +2317,9 @@ _disco_info_response_id_handler(xmpp_stanza_t* const stanza, void* const userdat
                 }
             } else if (g_strcmp0(stanza_name, STANZA_NAME_IDENTITY) == 0) {
                 const char* name = xmpp_stanza_get_attribute(child, STANZA_ATTR_NAME);
-                const char* type = xmpp_stanza_get_type(child);
                 const char* category = xmpp_stanza_get_attribute(child, STANZA_ATTR_CATEGORY);
 
-                if (name || category || type) {
+                if (name || category || child_type) {
                     DiscoIdentity* identity = malloc(sizeof(struct disco_identity_t));
 
                     if (identity) {
@@ -2332,8 +2333,8 @@ _disco_info_response_id_handler(xmpp_stanza_t* const stanza, void* const userdat
                         } else {
                             identity->category = NULL;
                         }
-                        if (type) {
-                            identity->type = strdup(type);
+                        if (child_type) {
+                            identity->type = strdup(child_type);
                         } else {
                             identity->type = NULL;
                         }
@@ -2341,6 +2342,23 @@ _disco_info_response_id_handler(xmpp_stanza_t* const stanza, void* const userdat
                         identities = g_slist_append(identities, identity);
                     }
                 }
+            } else if (g_strcmp0(child_type, STANZA_TYPE_RESULT) == 0) {
+                /*
+                DataForm* form = form_create(child);
+                ProfConfWin* confwin = (ProfConfWin*)wins_new_config(from, form, NULL, NULL, NULL);
+                confwin_handle_configuration(confwin, form);
+                */
+                /*g_hash_table_new () with field var='security-addresses' as key
+                 * a list of  <value>xmpp:security@shakespeare.lit</value> as value
+                 */
+                stanza_get_service_contact_addresses(connection_get_ctx(), child);
+                    /*
+                char* text;
+                size_t text_size;
+                xmpp_stanza_to_text(child, &text, &text_size);
+                cons_show(text);
+                free(text);
+                */
             }
 
             child = xmpp_stanza_get_next(child);