1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

progress on fixing registration

doesnt segfault on register, but aborts when you type after registering

need to find a way to disconnect later
This commit is contained in:
swirl 2021-07-18 17:25:07 -04:00
parent 4d3f26154e
commit 8a6f1b52d7
2 changed files with 6 additions and 8 deletions

View File

@ -9595,12 +9595,10 @@ cmd_register(ProfWin* window, const char* const command, gchar** args)
if (g_strcmp0(passwd, confirm_passwd) == 0) {
log_info("Attempting to register account %s on server %s.", username, server);
connection_register((server), port, tls_policy, auth_policy, username, passwd);
//iq_register_new_account(username, passwd);
connection_register(server, port, tls_policy, auth_policy, username, passwd);
} else {
cons_show("The two passwords do not match.");
}
//jabber_conn_status_t conn_status = cl_ev_connect_raw(server, port, tls_policy, auth_policy);
if (connection_get_status() == JABBER_DISCONNECTED) {
cons_show_error("Connection attempt to server %s port %d failed.", server, port);
@ -9610,7 +9608,6 @@ cmd_register(ProfWin* window, const char* const command, gchar** args)
free(passwd);
free(confirm_passwd);
//}
options_destroy(options);

View File

@ -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();
//connection_disconnect();
return 0;
}
@ -506,7 +506,6 @@ _register_handle_features(xmpp_conn_t *xmpp_conn, xmpp_stanza_t *stanza, void *u
log_debug("Server supports in-band registration. Attempting registration.");
domain = strdup(conn.domain);
iq = xmpp_iq_new(ctx, "get", "reg1");
xmpp_stanza_set_to(iq, domain);
@ -671,7 +670,8 @@ connection_register(const char* const altdomain, int port,
int connect_status = xmpp_connect_raw(
conn.xmpp_conn,
strdup(altdomain),
//strdup(altdomain),
altdomain,
port,
_connection_certfail_cb,
_register_handler,
@ -679,7 +679,8 @@ connection_register(const char* const altdomain, int port,
#else
int connect_status = xmpp_connect_raw(
conn.xmpp_conn,
strdup(altdomain),
//strdup(altdomain),
altdomain,
port,
_register_handler,
reg);