Refactored connecting, and reconnecting
The user either logs in with an account, in which case its name, and the password is kept for reconnects. Or the user can login with a jid (and server) which does not currently exist as a local account. On success an account is created, with the jid as the name.
This commit is contained in:
@@ -1017,13 +1017,11 @@ _cmd_connect(gchar **args, struct cmd_help_t help)
|
||||
jid = strdup(account->jid);
|
||||
}
|
||||
cons_show("Connecting with account %s as %s", account->name, jid);
|
||||
log_debug("Connecting with account %s as %s", account->name, jid);
|
||||
conn_status = jabber_connect_with_account(account, passwd);
|
||||
} else {
|
||||
jid = strdup(lower);
|
||||
cons_show("Connecting as %s", jid);
|
||||
log_debug("Connecting as %s", jid);
|
||||
conn_status = jabber_connect(jid, passwd, altdomain);
|
||||
conn_status = jabber_connect_with_details(jid, passwd, altdomain);
|
||||
}
|
||||
|
||||
if (conn_status == JABBER_DISCONNECTED) {
|
||||
|
||||
Reference in New Issue
Block a user