about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-09-24 00:30:05 +0100
committerJames Booth <boothj5@gmail.com>2014-09-24 00:30:05 +0100
commit95a2cec9532cfaec91ed8285e69419d38e9b8a17 (patch)
tree506b7772b3421e199340b80e22c91ec13836d9e1 /src/xmpp
parent999525c6aa25c9d52cc7c40461c342cc6a4e28c9 (diff)
downloadprofani-tty-95a2cec9532cfaec91ed8285e69419d38e9b8a17.tar.gz
Handle errors for /disco info requests
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/capabilities.c2
-rw-r--r--src/xmpp/iq.c12
2 files changed, 12 insertions, 2 deletions
diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c
index 2cf41226..94523a30 100644
--- a/src/xmpp/capabilities.c
+++ b/src/xmpp/capabilities.c
@@ -400,7 +400,7 @@ caps_create(xmpp_stanza_t *query)
         }
         if (found) {
             break;
-        } 
+        }
         curr_identity = g_slist_next(curr_identity);
     }
 
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index 81ba6e09..f701aa53 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -812,8 +812,18 @@ static int
 _disco_info_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
     void * const userdata)
 {
-    log_debug("Received diso#info response");
+    log_info("Received diso#info response");
+
     const char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
+    const char *type = xmpp_stanza_get_type(stanza);
+
+    // handle error responses
+    if (g_strcmp0(type, STANZA_TYPE_ERROR) == 0) {
+        char *error_message = stanza_get_error_message(stanza);
+        handle_disco_info_error(from, error_message);
+        free(error_message);
+        return 0;
+    }
 
     xmpp_stanza_t *query = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_QUERY);