about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-07-14 16:23:05 +0200
committerswirl <roachh@protonmail.com>2021-08-17 14:09:48 -0400
commitf53b4353fdba469297ee97ff4947f830bfd79f53 (patch)
tree4494103c6690bd3ea3bad6c404663a1bee136cc0 /src
parent8a6f1b52d76213d213c6e43f2b1d2fa40c3d09ea (diff)
downloadprofani-tty-f53b4353fdba469297ee97ff4947f830bfd79f53.tar.gz
REGISTRATION FIXED
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/connection.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c
index da381898..2d2df7c2 100644
--- a/src/xmpp/connection.c
+++ b/src/xmpp/connection.c
@@ -380,7 +380,7 @@ static int iq_reg2_cb(xmpp_conn_t *xmpp_conn, xmpp_stanza_t *stanza, void *userd
     goto quit;
 
 quit:
-    //connection_disconnect();
+    xmpp_disconnect(xmpp_conn);
 
     return 0;
 }
@@ -397,13 +397,13 @@ static int iq_reg_cb(xmpp_conn_t *xmpp_conn, xmpp_stanza_t *stanza, void *userda
         char* error_message = stanza_get_error_message(stanza);
         cons_show_error("Server error: %s", error_message);
         log_debug("Registration error: %s", error_message);
-        connection_disconnect();
+        xmpp_disconnect(xmpp_conn);
         goto quit;
     }
 
     if (strcmp(type, "result") != 0) {
         log_debug("Expected type 'result', but got %s.", type);
-        connection_disconnect();
+        xmpp_disconnect(xmpp_conn);
         goto quit;
     }
 
@@ -413,7 +413,7 @@ static int iq_reg_cb(xmpp_conn_t *xmpp_conn, xmpp_stanza_t *stanza, void *userda
     if (registered != NULL) {
         cons_show_error("Already registered.");
         log_debug("Already registered.");
-        connection_disconnect();
+        xmpp_disconnect(xmpp_conn);
         goto quit;
     }
     xmpp_stanza_t* iq = stanza_register_new_account(conn.xmpp_ctx, reg->username, reg->password);
@@ -433,7 +433,7 @@ _register_handle_error(xmpp_conn_t *xmpp_conn, xmpp_stanza_t *stanza, void *user
     char* error_message = stanza_get_error_message(stanza);
     cons_show_error("Server error: %s", error_message);
     log_debug("Registration error: %s", error_message);
-    connection_disconnect();
+    xmpp_disconnect(xmpp_conn);
 
     return 0;
 }
@@ -454,7 +454,7 @@ static int _register_handle_proceedtls_default(xmpp_conn_t *xmpp_conn,
         } else {
             log_debug("TLS failed.");
             /* failed tls spoils the connection, so disconnect */
-            connection_disconnect();
+            xmpp_disconnect(xmpp_conn);
         }
     }
     return 0;
@@ -465,7 +465,7 @@ static int _register_handle_missing_features(xmpp_conn_t *xmpp_conn, void *userd
     (void)userdata;
 
     log_debug("Timeout");
-    connection_disconnect();
+    xmpp_disconnect(xmpp_conn);
 
     return 0;
 }
@@ -500,7 +500,7 @@ _register_handle_features(xmpp_conn_t *xmpp_conn, xmpp_stanza_t *stanza, void *u
     if (child && strcmp(xmpp_stanza_get_ns(child), XMPP_NS_REGISTER) == 0) {
         log_debug("Server does not support in-band registration.");
         cons_show_error("Server does not support in-band registration, aborting.");
-        connection_disconnect();
+        xmpp_disconnect(xmpp_conn);
         return 0;
     }