fixed some bugs, added some more

- Added JABBER_RAW_CONNECT[ING/ED] connection states
- Added cl_ev_connect_raw and session_connect_raw to conform to normal
connection functions
- Fixed SIGABRT during registration
- Added a check in cmd_register to ensure it's actually connected before
registering--but this will always fail atm
This commit is contained in:
swirl
2021-07-04 19:02:38 -04:00
parent 5ea1ccbb46
commit 2cc354b6ae
9 changed files with 96 additions and 15 deletions

View File

@@ -9589,7 +9589,7 @@ cmd_register(ProfWin* window, const char* const command, gchar** args)
char* server = args[1];
jabber_conn_status_t conn_status = connection_connect_raw(server, port, tls_policy, auth_policy);
jabber_conn_status_t conn_status = cl_ev_connect_raw(server, port, tls_policy, auth_policy);
if (conn_status == JABBER_DISCONNECTED) {
cons_show_error("Connection attempt to server %s port %d failed.", server, port);
@@ -9598,19 +9598,26 @@ cmd_register(ProfWin* window, const char* const command, gchar** args)
}
char* username = args[0];
char* passwd = ui_ask_password(false);
char* confirm_passwd = ui_ask_password(true);
if (connection_get_status() != JABBER_RAW_CONNECTED) { // FIXME: this is ALWAYS the case, as the connection doesn't finish by this time.
cons_show_error("Raw connection attempt failed or not yet completed.");
log_info("Raw connection attempt failed or not yet completed.");
} //else {
char* passwd = ui_ask_password(false);
char* confirm_passwd = ui_ask_password(true);
if (g_strcmp0(passwd, confirm_passwd) == 0) {
iq_register_new_account(username, passwd);
} else {
cons_show("The two passwords do not match.");
}
if (g_strcmp0(passwd, confirm_passwd) == 0) {
log_info("Attempting to register account %s on server %s.", username, server);
iq_register_new_account(username, passwd);
} else {
cons_show("The two passwords do not match.");
}
free(passwd);
free(confirm_passwd);
//}
free(username);
free(passwd);
free(confirm_passwd);
options_destroy(options);
log_info("we are leaving the registration process");
return TRUE;
}